Skip to content

Commit 18da5e6

Browse files
committed
CMake: Update msvc 1940+ warnings with the NVCC_PREPEND_FLAGS workaround
1 parent 6106896 commit 18da5e6

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

cmake/CheckCompilerFunctionality.cmake

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,46 @@ function(flamegpu_visualiser_check_compiler_functionality)
2525
message(WARNING
2626
" CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1941)\n"
2727
" \n"
28-
" The MSVC STL included with MSVC 1941 requires CUDA 12.4 or newer\n"
29-
" If you have CUDA <= 12.3 installed you must either:\n"
28+
" The MSVC STL included with MSVC >= 1941 requires CUDA >= 12.4\n"
29+
" If you have CUDA < 12.4 installed you must either:\n"
30+
" \n"
31+
" - Set the NVCC_PREPEND_FLAGS environment variable to include '-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -allow-unsupported-compiler' for configuration and compilation\n"
3032
" - Upgrade CUDA to >= 12.4\n"
3133
" - Downgrade MSVC to 1940 and set the CUDAFLAGS environment variable to contain '-allow-unsupported-compiler'\n"
3234
" - Downgrade MSVC to 1939 or older\n"
33-
" You must then clear the CMake cache before reconfiguring\n"
35+
" \n"
36+
" You must clear the CMake Cache before reconfiguring this project\n"
3437
)
3538
# If using MSVC >= 1940 then CUDA <= 12.3 support requires -allow-unsupported-compiler, so warn about this
3639
elseif(MSVC AND MSVC_VERSION VERSION_GREATER_EQUAL "1940")
3740
# If this is the case, then CMake >= 3.29.4 is also required, otherwise CMake does not pass -allow-unsupported-compiler along, warn as appropriate
3841
if(CMAKE_VERSION VERSION_LESS "3.29.4")
3942
message(WARNING
40-
" CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940)\n"
43+
" CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940 and CMake < 3.29.4)\n"
44+
" \n"
45+
" If you have CUDA <= 12.3 installed you must either:\n"
4146
" \n"
42-
" If you have CUDA <= 12.3 installed:\n"
43-
" - You must upgrade CMake to be >= 3.29.4\n"
44-
" The CUDAFLAGS environment variable must include '-allow-unsupported-compiler'\n"
45-
" You must clear the CMake Cache before reconfiguring this project\n"
47+
" - Set the NVCC_PREPEND_FLAGS environment variable to include '-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -allow-unsupported-compiler' for configuration and compilation\n"
48+
" - Upgrade CMake to >= 3.29.4 and set the CUDAFLAGS environment variable to contain '-allow-unsupported-compiler'\n"
49+
" - Upgrade CUDA to >= 12.4\n"
50+
" - Downgrade MSVC to 1939 or older\n"
51+
" \n"
52+
" You must clear the CMake Cache before reconfiguring this project\n"
4653
" \n"
47-
" - Alternatively you may upgrade CUDA to >= 12.4 and clear the CMake Cache before reconfiguring\n"
4854
)
4955
else()
5056
message(WARNING
51-
" CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940)\n"
57+
" CUDA Language Support Not Found (with MSVC ${MSVC_VERSION} >= 1940 and CMake >= 3.29.4)\n"
58+
" \n"
59+
" If you have CUDA <= 12.3 installed you must either:\n"
60+
" \n"
61+
" - Set the NVCC_PREPEND_FLAGS environment variable to include '-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -allow-unsupported-compiler' for configuration and compilation\n"
62+
" - Set the CUDAFLAGS environment variable to contain '-allow-unsupported-compiler'\n"
63+
" - Upgrade CUDA to >= 12.4\n"
64+
" - Downgrade MSVC to 1939 or older\n"
5265
" \n"
53-
" If you have CUDA <= 12.3 installed:\n"
54-
" - The CUDAFLAGS environment variable must include '-allow-unsupported-compiler'\n"
55-
" You must clear the CMake Cache before reconfiguring this project\n"
66+
" You must clear the CMake Cache before reconfiguring this project\n"
5667
" \n"
57-
" - Alternatively you may upgrade CUDA to >= 12.4 and clear the CMake Cache before reconfiguring\n"
5868
)
5969
endif()
6070
else()

0 commit comments

Comments
 (0)