Imported Upstream version 3.24.3
[platform/upstream/cmake.git] / Tests / RunCMake / CheckCompilerFlag / CheckCUDACompilerFlag.cmake
1
2 enable_language (CUDA)
3 include(CheckCompilerFlag)
4
5 set(CUDA 1) # test that this is tolerated
6
7 check_compiler_flag(CUDA "-_this_is_not_a_flag_" SHOULD_FAIL)
8 if(SHOULD_FAIL)
9   message(SEND_ERROR "invalid CUDA compile flag didn't fail.")
10 endif()
11
12 check_compiler_flag(CUDA "-DFOO" SHOULD_WORK)
13 if(NOT SHOULD_WORK)
14   message(SEND_ERROR "${CMAKE_CUDA_COMPILER_ID} compiler flag '-DFOO' check failed")
15 endif()