cmake/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake

21 lines
387 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
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()