summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CheckSourceCompiles/CheckISPCSourceCompiles.cmake
blob: 74b83c083abaf1effbe5995a7e1be771b8111b5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()