diff options
author | Brad King <brad.king@kitware.com> | 2017-11-17 14:20:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-17 14:51:39 (GMT) |
commit | 00e13993fde86d3674882aa9e63c46b4e1041462 (patch) | |
tree | 2f6da1b00ece1c746c15ef404b1bad5245e47b7c /Tests/CudaOnly | |
parent | 8e6d6337cdfa62dd5412057c6dcb6d7c23709f6e (diff) | |
download | CMake-00e13993fde86d3674882aa9e63c46b4e1041462.zip CMake-00e13993fde86d3674882aa9e63c46b4e1041462.tar.gz CMake-00e13993fde86d3674882aa9e63c46b4e1041462.tar.bz2 |
CUDA: Add CMAKE_CUDA_SEPARABLE_COMPILATION variable
Use its value to initialize the `CUDA_SEPARABLE_COMPILATION` target
property when targets are created.
Fixes: #17478
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r-- | Tests/CudaOnly/SeparateCompilation/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 7ef626f..cfca823 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -13,7 +13,13 @@ string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) +set(CMAKE_CUDA_SEPARABLE_COMPILATION ON) add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu) +get_property(sep_comp TARGET CUDASeparateLibA PROPERTY CUDA_SEPARABLE_COMPILATION) +if(NOT sep_comp) + message(FATAL_ERROR "CUDA_SEPARABLE_COMPILATION not initialized") +endif() +unset(CMAKE_CUDA_SEPARABLE_COMPILATION) if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") # Test adding a flag that is not in our CUDA flag table for VS. |