diff options
author | Stephen Sorley <Stephen.Sorley@jhuapl.edu> | 2016-08-11 19:20:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-12 13:26:30 (GMT) |
commit | aab1f6e984e81f732ec2dd5c33ff8f7bf604a0f2 (patch) | |
tree | 94459bbd2b9825880184ebaf8b55275bf6253cff /Modules/FindCUDA.cmake | |
parent | f203694bb848e7a4bd2c623348053532b1b4e589 (diff) | |
download | CMake-aab1f6e984e81f732ec2dd5c33ff8f7bf604a0f2.zip CMake-aab1f6e984e81f732ec2dd5c33ff8f7bf604a0f2.tar.gz CMake-aab1f6e984e81f732ec2dd5c33ff8f7bf604a0f2.tar.bz2 |
FindCUDA: Restore default behavior of CUDA_USE_STATIC_CUDA_RUNTIME
Fix bug introduced by commit 7229ae72 (FindCUDA: Refactor Android(Tegra)
support, 2016-04-19). `CUDA_USE_STATIC_CUDA_RUNTIME` should be enabled
by default if `cudart_static` is available, and silently disabled if
it is not.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index d7c9d8a..972068b 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -779,18 +779,19 @@ if(CUDA_VERSION VERSION_EQUAL "3.0") ) endif() -if(CUDA_USE_STATIC_CUDA_RUNTIME AND NOT CUDA_VERSION VERSION_LESS "5.5") +if(NOT CUDA_VERSION VERSION_LESS "5.5") cuda_find_library_local_first(CUDA_cudart_static_LIBRARY cudart_static "static CUDA runtime library") mark_as_advanced(CUDA_cudart_static_LIBRARY) endif() if(CUDA_cudart_static_LIBRARY) - # Set whether to use the static cuda runtime. + # 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() - option(CUDA_USE_STATIC_CUDA_RUNTIME "Use the static version of the CUDA runtime library if available" OFF) + # If not available, silently disable the option. + set(CUDA_USE_STATIC_CUDA_RUNTIME OFF CACHE INTERNAL "") set(CUDA_CUDART_LIBRARY_VAR CUDA_CUDART_LIBRARY) endif() |