diff options
author | Brad King <brad.king@kitware.com> | 2020-05-21 15:19:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-22 10:50:19 (GMT) |
commit | d8eee80e3091ebdc1af2208ec6e94d885b279be9 (patch) | |
tree | b3e9b51d85b895e0f89c75a6b71d95c6769f320e /Modules/CMakeDetermineCompilerId.cmake | |
parent | 345d707cf0d68c27edcaa9f76ac3257303750b70 (diff) | |
parent | e55b21e24ee81f5433b8ec778aa341c485d6e149 (diff) | |
download | CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.zip CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.tar.gz CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.tar.bz2 |
Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 9ebaa6c..df48fa5 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -381,7 +381,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} if(CMAKE_VS_PLATFORM_NAME STREQUAL x64) set(id_ItemDefinitionGroup_entry "<CudaCompile><TargetMachinePlatform>64</TargetMachinePlatform><AdditionalOptions>%(AdditionalOptions)-v</AdditionalOptions></CudaCompile>") endif() - set(id_Link_AdditionalDependencies "<AdditionalDependencies>cudart.lib</AdditionalDependencies>") + if(CMAKE_CUDA_FLAGS MATCHES "(^| )-cudart +shared( |$)") + set(id_Link_AdditionalDependencies "<AdditionalDependencies>cudart.lib</AdditionalDependencies>") + else() + set(id_Link_AdditionalDependencies "<AdditionalDependencies>cudart_static.lib</AdditionalDependencies>") + endif() endif() configure_file(${CMAKE_ROOT}/Modules/CompilerId/VS-${v}.${ext}.in ${id_dir}/CompilerId${lang}.${ext} @ONLY) |