diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-24 19:31:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-10-08 12:30:59 (GMT) |
commit | da2622ff366e6089a98109c68ececac58d598b66 (patch) | |
tree | 8205c6455c1c996ccb39d6270b8de385a92e78bb /Tests/RunCMake/CheckCompilerFlag | |
parent | c61f820a7fb1b191fe5591805f7e53fc52424f93 (diff) | |
download | CMake-da2622ff366e6089a98109c68ececac58d598b66.zip CMake-da2622ff366e6089a98109c68ececac58d598b66.tar.gz CMake-da2622ff366e6089a98109c68ececac58d598b66.tar.bz2 |
CUDA: Add Support to SourceCompiles|Runs and CheckCompilerFlags
Diffstat (limited to 'Tests/RunCMake/CheckCompilerFlag')
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake | 13 | ||||
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake | 4 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake new file mode 100644 index 0000000..a40699c --- /dev/null +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake @@ -0,0 +1,13 @@ + +enable_language (CUDA) +include(CheckCompilerFlag) + +check_compiler_flag(CUDA "-_this_is_not_a_flag_" SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "invalid CUDA compile flag didn't fail.") +endif() + +check_compiler_flag(CUDA "-DFOO" SHOULD_WORK) +if(NOT SHOULD_WORK) + message(SEND_ERROR "${CMAKE_CUDA_COMPILER_ID} compiler flag '-DFOO' check failed") +endif() diff --git a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake index e4d65b8..7a4e2ce 100644 --- a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake @@ -15,6 +15,10 @@ if (CMAKE_Fortran_COMPILER_ID) run_cmake(CheckFortranCompilerFlag) endif() +if (CMake_TEST_CUDA) + run_cmake(CheckCUDACompilerFlag) +endif() + if(CMake_TEST_ISPC) run_cmake(CheckISPCCompilerFlag) endif() |