diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2020-09-24 19:39:00 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2020-10-06 14:47:20 (GMT) |
commit | e17e2c6a517cf40b41014cdf3e239c0b21da868e (patch) | |
tree | 214a35d04a2214d1aa9d074cad80672ce1cb0f18 /Tests/RunCMake/CheckSourceCompiles | |
parent | a12da6fb5ece6baf3b4540d8204b8b29dde92538 (diff) | |
download | CMake-e17e2c6a517cf40b41014cdf3e239c0b21da868e.zip CMake-e17e2c6a517cf40b41014cdf3e239c0b21da868e.tar.gz CMake-e17e2c6a517cf40b41014cdf3e239c0b21da868e.tar.bz2 |
ISPC: CheckCompilerFlags and CheckSourceCompiles support ISPC
Diffstat (limited to 'Tests/RunCMake/CheckSourceCompiles')
-rw-r--r-- | Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake | 20 | ||||
-rw-r--r-- | Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake | 4 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake new file mode 100644 index 0000000..74b83c0 --- /dev/null +++ b/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake @@ -0,0 +1,20 @@ + +enable_language (ISPC) +include(CheckSourceCompiles) + +check_source_compiles(ISPC "I don't build" SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "invalid ISPC source didn't fail.") +endif() + +check_source_compiles(ISPC [=[ + +float func(uniform int32, float a) +{ + return a / 2.25; +} +]=] + SHOULD_BUILD) +if(NOT SHOULD_BUILD) + message(SEND_ERROR "Test fail for valid ISPC source.") +endif() diff --git a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake index bf32828..a574d7d 100644 --- a/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/RunCMakeTest.cmake @@ -14,3 +14,7 @@ endif() if (CMAKE_Fortran_COMPILER_ID) run_cmake(CheckFortranSourceCompiles) endif() + +if(CMake_TEST_ISPC) + run_cmake(CheckISPCSourceCompiles) +endif() |