diff options
author | Brad King <brad.king@kitware.com> | 2017-06-22 14:04:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-06-22 14:04:37 (GMT) |
commit | 396b618c523d042df1c96cb08be1163e5c72d150 (patch) | |
tree | ce540d2974d815148c95a9618db5dbed6a054bab /Tests/CudaOnly | |
parent | 416e7919ec92d2899e27949132fce59a1926aeab (diff) | |
parent | 3b75421515835b2fc6713be3015cc3f7324bb5a8 (diff) | |
download | CMake-396b618c523d042df1c96cb08be1163e5c72d150.zip CMake-396b618c523d042df1c96cb08be1163e5c72d150.tar.gz CMake-396b618c523d042df1c96cb08be1163e5c72d150.tar.bz2 |
Merge topic 'vs-cuda-fix-flags'
3b754215 VS: Improve workaround for CUDA -Xcompiler placement bug
f2059585 VS: Fix target_compile_options for CUDA
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !996
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r-- | Tests/CudaOnly/SeparateCompilation/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CudaOnly/WithDefs/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/CudaOnly/WithDefs/main.notcu | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt index 55fd79f..b946e3f 100644 --- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt +++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt @@ -15,6 +15,10 @@ set(CMAKE_CUDA_STANDARD 11) add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu) +if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC") + target_compile_options(CUDASeparateLibA PRIVATE -Xcompiler=-bigobj) +endif() + #Having file4/file5 in a shared library causes serious problems #with the nvcc linker and it will generate bad entries that will #cause a segv when trying to run the executable diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index fe0ccc6..0bc4e5c 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -28,6 +28,7 @@ add_executable(CudaOnlyWithDefs ${main}) target_compile_options(CudaOnlyWithDefs PRIVATE + -Xcompiler=-DHOST_DEFINE $<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>> ) diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu index 80ed3a5..d2eff3f 100644 --- a/Tests/CudaOnly/WithDefs/main.notcu +++ b/Tests/CudaOnly/WithDefs/main.notcu @@ -2,6 +2,10 @@ #include <cuda_runtime.h> #include <iostream> +#ifndef HOST_DEFINE +#error "HOST_DEFINE not defined!" +#endif + #ifndef PACKED_DEFINE #error "PACKED_DEFINE not defined!" #endif |