diff options
author | Brad King <brad.king@kitware.com> | 2017-08-11 13:12:15 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-08-11 13:12:18 (GMT) |
commit | 485cbd456aae395da1661b08161751c3c3b47a96 (patch) | |
tree | dd6a8dd3484ead40663ca44e6265b82f19038b9b /Modules | |
parent | eda45e9f17cdc401c6450d0e8eca65e5b068330f (diff) | |
parent | d9c8aa47c2e7a2f97def22847a76c3cfcba74f01 (diff) | |
download | CMake-485cbd456aae395da1661b08161751c3c3b47a96.zip CMake-485cbd456aae395da1661b08161751c3c3b47a96.tar.gz CMake-485cbd456aae395da1661b08161751c3c3b47a96.tar.bz2 |
Merge topic 'findcuda_dont_ignore_CUDA_USE_STATIC_CUDA_RUNTIME'
d9c8aa47 FindCUDA: Always obey the CUDA_USE_STATIC_CUDA_RUNTIME option.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1123
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDA.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 5dc55d4..b79f787 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -589,7 +589,6 @@ macro(cuda_unset_include_and_libraries) unset(CUDA_npps_LIBRARY CACHE) unset(CUDA_nvcuvenc_LIBRARY CACHE) unset(CUDA_nvcuvid_LIBRARY CACHE) - unset(CUDA_USE_STATIC_CUDA_RUNTIME CACHE) unset(CUDA_GPU_DETECT_OUTPUT CACHE) endmacro() @@ -802,12 +801,17 @@ endif() if(CUDA_cudart_static_LIBRARY) # If static cudart available, use it by default, but provide a user-visible option to disable it. option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" ON) - set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) else() # If not available, silently disable the option. set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") +endif() + +if(CUDA_USE_STATIC_CUDA_RUNTIME) + set(CUDA_CUDART_LIBRARY_VAR CUDA_cudart_static_LIBRARY) +else() set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) endif() + if(NOT CUDA_VERSION VERSION_LESS "5.0") cuda_find_library_local_first(CUDA_cudadevrt_LIBRARY cudadevrt "\"cudadevrt\" library") mark_as_advanced(CUDA_cudadevrt_LIBRARY) |