Reputation: 19
After a vs code update (2024-05 update) my build using cmake did not work anymore. Somewhere along the way a include path in my Cmakefiles.txt got lost and wouldn't work anymore. This also happened when rolling back to previously stable versions of my code. The problem was with the GLM header, that somehow changed directories.
The glm setup went like this:
set(DEP_DIR ${CMAKE_CURRENT_BINARY_DIR}/dep)
set(GLM_INSTALL_DIR ${DEP_DIR}/glm/install)
set(libGLM glm)
ExternalProject_Add(${libGLM}
PREFIX ${DEP_DIR}/${libGLM}
GIT_REPOSITORY https://github.com/g-truc/glm.git
LOG_DOWNLOAD ON
BUILD_COMMAND ""
INSTALL_COMMAND ""
UPDATE_DISCONNECTED 1 # Do not update the external project if it is already downloaded
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${GLM_INSTALL_DIR}
-DGLAD_INSTALL:BOOL=ON
-DGLAD_PROFILE:STRING="core"
-DGLAD_ALL_EXTENSIONS:BOOL=ON
-DUSE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF
)
target_include_directories(${EXECUTABLE_NAME}
PUBLIC ${GLM_INSTALL_DIR}/include
)
This worked for ages, but when changing another library in cmake I cleaned out the whole build folder for a clean installation. Now the actually path of GLM is not
${DEP_DIR}/glm/install)
but
${DEP_DIR}/glm/src/glm)
When changing the paths to this directory the header was found and the compilation is fine, however I'm getting a ton of warnings now in my code that I didn't have before: (showing one of each warning type here)
[...]build\dep\glm\src\glm\glm\ext\../detail/type_vec2.hpp(101): warning #20012-D: __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration [...]
__declspec(__device__) __declspec(__host__) vec() = default;
[...]dep\glm\src\glm\glm\ext\../detail/type_mat2x3.hpp(36): warning #20012-D: __device__ annotation is ignored on a function("mat") that is explicitly defaulted on its first declaration [...]
__declspec(__device__) __declspec(__host__) mat() = default;
[...]dep\glm\src\glm\glm\detail\_vectorize.hpp(104): warning #20013-D: calling a constexpr __host__ function("operator()") from a __host__ __device__ function("call") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this. [...]
return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
I'm 90% sure, this is a screw up with the CmakeLists.txt file, but I can't tell what is wrong. All errors trace back to a camera class/header of mine, that is never used from device, nor does it have device functions.
As this only appeared after a VS Code update I thought this would be the cause. So I rolled back to the 2024-04 version. This fixed it (no more warnings). However the same warnings reappeared a few days later, now in the older version.
What are those warnings? Why didn't they appear earlier? Is there a "safe" way to suppress them?
Upvotes: 0
Views: 187