diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d9cb0635..85316f68f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ else() endif() -if(NOT MSVC AND NOT EMSCRIPTEN) +if(UNIX AND NOT EMSCRIPTEN) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") @@ -123,8 +123,19 @@ else() endif() endif() +# workaround for +# CMake Error at build/_deps/dawn-src/third_party/abseil-cpp/CMake/AbseilDll.cmake:730 (message): +# The compiler defaults to or is configured for C++ < 17. C++ >= 17 is +# required and Abseil and all libraries that use Abseil must use the same C++ +# language standard +if(SUPPORT_WGPU_BACKEND) + set(ABSL_INTERNAL_AT_LEAST_CXX17 ON CACHE BOOL "Force C++17 check" FORCE) + set(ABSL_INTERNAL_AT_LEAST_CXX20 ON CACHE BOOL "Force C++20 check" FORCE) +endif() - +if(WIN32) + add_compile_definitions(NOMINMAX _CRT_SECURE_NO_WARNINGS) # fix dawn error and silence warnings +endif() if((SUPPORT_WGPU_BACKEND OR SUPPORT_WGSL_PARSER) AND NOT EMSCRIPTEN) set(DAWN_IS_IN_USE True) @@ -449,8 +460,8 @@ else() if(SUPPORT_GLSL_PARSER) list(APPEND raygpu_linked_deps glslang) endif() + target_include_directories(${raygpu_core_library_name} PRIVATE "amalgamation/vulkan_headers/include") # need for some window backends (RGFW) if(SUPPORT_VULKAN_BACKEND) - target_include_directories(${raygpu_core_library_name} PRIVATE "amalgamation/vulkan_headers/include") list(APPEND raygpu_linked_deps wgvk) else() list(APPEND raygpu_linked_deps webgpu_dawn) diff --git a/examples/models_forwardkinematics.cpp b/examples/models_forwardkinematics.cpp index 451b1a49d..bf68d280b 100644 --- a/examples/models_forwardkinematics.cpp +++ b/examples/models_forwardkinematics.cpp @@ -2,6 +2,10 @@ #include // For storing points dynamically (optional but clean) #include // For sinf +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923f +#endif + // --- FK Function adapted for MathUtils.h --- // Helper to compute the transformation matrix for a single joint (MDH) @@ -184,4 +188,4 @@ int main(void) { //CloseWindow(); // Close window and OpenGL context return 0; -} \ No newline at end of file +} diff --git a/include/external/sinfl.h b/include/external/sinfl.h index 3c7173777..5d9db7030 100644 --- a/include/external/sinfl.h +++ b/include/external/sinfl.h @@ -142,6 +142,9 @@ extern int zsinflate(void *out, int cap, const void *in, int size); #include /* memcpy, memset */ #include /* assert */ +#if defined(_WIN32) || defined(_WIN64) +#include /* _BitScanReverse */ +#endif #if defined(__GNUC__) || defined(__clang__) #define sinfl_likely(x) __builtin_expect((x),1) @@ -626,4 +629,3 @@ zsinflate(void *out, int cap, const void *mem, int size) { } } #endif - diff --git a/src/platform/InitWindow_RGFW.c b/src/platform/InitWindow_RGFW.c index 6f8c4c2c2..18d1e3336 100644 --- a/src/platform/InitWindow_RGFW.c +++ b/src/platform/InitWindow_RGFW.c @@ -272,7 +272,6 @@ const int keyMappingRGFW_(int RGFWKey){ #endif #include #define RGFW_VULKAN -#include #ifdef _WIN32 #undef AdapterType #undef ShowCursor @@ -286,7 +285,7 @@ const int keyMappingRGFW_(int RGFWKey){ #define RGFW_WASM #endif #endif - +#include #include #include