diff options
author | Brad King <brad.king@kitware.com> | 2017-11-27 14:00:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-11-27 14:00:44 (GMT) |
commit | 1882ba2e0506deeb06f334b7459921286238d719 (patch) | |
tree | 3ac503b319e019545d4e08cbfa131b967d00bd1b /Tests/CudaOnly | |
parent | b67762ff3c4e24be75090cb2dca6c2b0e7f08dcb (diff) | |
parent | 2ae880fa8f04a2026939b1df9613b64a301aa522 (diff) | |
download | CMake-1882ba2e0506deeb06f334b7459921286238d719.zip CMake-1882ba2e0506deeb06f334b7459921286238d719.tar.gz CMake-1882ba2e0506deeb06f334b7459921286238d719.tar.bz2 |
Merge topic 'extend-compile-language-genex'
2ae880fa Genex: Enable COMPILE_LANGUAGE for COMPILE_OPTIONS with Visual Studio
2b7d59f3 Genex: Enable COMPILE_LANGUAGE for file(GENERATE) with Visual Studio
0f6f7c8a Genex: Fix COMPILE_LANGUAGE messages to allow file(GENERATE) with Xcode
c5a82d0f Tests: Decouple COMPILE_LANGUAGE in file(GENERATE) from COMPILE_OPTIONS
25773650 Tests: Remove unnecessary result files from RunCMake.File_Generate
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jason Juang <jasjuang@gmail.com>
Merge-request: !1511
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r-- | Tests/CudaOnly/WithDefs/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CudaOnly/WithDefs/main.notcu | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt index 9b82366..5bd93a4 100644 --- a/Tests/CudaOnly/WithDefs/CMakeLists.txt +++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt @@ -32,6 +32,8 @@ add_executable(CudaOnlyWithDefs ${main}) target_compile_options(CudaOnlyWithDefs PRIVATE + -DCOMPILE_LANG_$<COMPILE_LANGUAGE> + -DLANG_IS_CUDA=$<COMPILE_LANGUAGE:CUDA> -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 d2eff3f..bfb3577 100644 --- a/Tests/CudaOnly/WithDefs/main.notcu +++ b/Tests/CudaOnly/WithDefs/main.notcu @@ -10,6 +10,18 @@ #error "PACKED_DEFINE not defined!" #endif +#ifndef COMPILE_LANG_CUDA +#error "COMPILE_LANG_CUDA not defined!" +#endif + +#ifndef LANG_IS_CUDA +#error "LANG_IS_CUDA not defined!" +#endif + +#if !LANG_IS_CUDA +#error "Expected LANG_IS_CUDA" +#endif + static __global__ void DetermineIfValidCudaDevice() { } |