summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CheckCompilerFlag
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-07 11:13:14 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-07 11:13:21 (GMT)
commitc61f820a7fb1b191fe5591805f7e53fc52424f93 (patch)
tree22d9ffd25ab39d2fd836656fcc69c0a29554abbc /Tests/RunCMake/CheckCompilerFlag
parent026beeb620f8f8c3939e128eb07c879133bf7d1c (diff)
parente17e2c6a517cf40b41014cdf3e239c0b21da868e (diff)
downloadCMake-c61f820a7fb1b191fe5591805f7e53fc52424f93.zip
CMake-c61f820a7fb1b191fe5591805f7e53fc52424f93.tar.gz
CMake-c61f820a7fb1b191fe5591805f7e53fc52424f93.tar.bz2
Merge topic 'add_ispc_to_check_helpers'
e17e2c6a51 ISPC: CheckCompilerFlags and CheckSourceCompiles support ISPC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5337
Diffstat (limited to 'Tests/RunCMake/CheckCompilerFlag')
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake13
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake4
2 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake
new file mode 100644
index 0000000..662319a
--- /dev/null
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckISPCCompilerFlag.cmake
@@ -0,0 +1,13 @@
+
+enable_language (ISPC)
+include(CheckCompilerFlag)
+
+check_compiler_flag(ISPC "-_this_is_not_a_flag_" SHOULD_FAIL)
+if(SHOULD_FAIL)
+ message(SEND_ERROR "invalid ISPC compile flag didn't fail.")
+endif()
+
+check_compiler_flag(ISPC "--woff" SHOULD_WORK)
+if(NOT SHOULD_WORK)
+ message(SEND_ERROR "${CMAKE_ISPC_COMPILER_ID} compiler flag '--woff' check failed")
+endif()
diff --git a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
index d56b8a9..e4d65b8 100644
--- a/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/RunCMakeTest.cmake
@@ -14,3 +14,7 @@ endif()
if (CMAKE_Fortran_COMPILER_ID)
run_cmake(CheckFortranCompilerFlag)
endif()
+
+if(CMake_TEST_ISPC)
+ run_cmake(CheckISPCCompilerFlag)
+endif()