diff options
author | Brad King <brad.king@kitware.com> | 2021-06-23 12:55:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-23 12:55:26 (GMT) |
commit | 60c5188fe5be9174f4deed4e45bf2c03c75b5447 (patch) | |
tree | 1d15cad34b9194f9c3721b44d07f578e9a1faf3f | |
parent | 6d9fec6c0ba13932afa42cac1c99c1ca9e74d108 (diff) | |
parent | 1d9009c27a5999f7793871e7f034ecdc3e8b280d (diff) | |
download | CMake-60c5188fe5be9174f4deed4e45bf2c03c75b5447.zip CMake-60c5188fe5be9174f4deed4e45bf2c03c75b5447.tar.gz CMake-60c5188fe5be9174f4deed4e45bf2c03c75b5447.tar.bz2 |
Merge topic 'cuda-rules-override' into release-3.21
1d9009c27a CUDA: Implement CMAKE_USER_MAKE_RULES_OVERRIDE[_CUDA]
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6253
-rw-r--r-- | Modules/CMakeCUDAInformation.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake index 541d207..a2946f4 100644 --- a/Modules/CMakeCUDAInformation.cmake +++ b/Modules/CMakeCUDAInformation.cmake @@ -36,6 +36,25 @@ if(CMAKE_CUDA_COMPILER_ID) endif() +# This should be included before the _INIT variables are +# used to initialize the cache. Since the rule variables +# have if blocks on them, users can still define them here. +# But, it should still be after the platform file so changes can +# be made to those values. + +if(CMAKE_USER_MAKE_RULES_OVERRIDE) + # Save the full path of the file so try_compile can use it. + include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) + set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") +endif() + +if(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA) + # Save the full path of the file so try_compile can use it. + include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA} RESULT_VARIABLE _override) + set(CMAKE_USER_MAKE_RULES_OVERRIDE_CUDA "${_override}") +endif() + + if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CUDA_FLAG) set(CMAKE_SHARED_LIBRARY_RUNTIME_CUDA_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) endif() |