11if (CMAKE_ISPC_COMPILER_FORCED)
2- # The compiler configuration was forced by the user.
3- # Assume the user has configured all compiler information.
2+ # ~~~
3+ # The compiler configuration was forced by the user. Assume the user has
4+ # configured all compiler information.
5+ # ~~~
46 set (CMAKE_ISPC_COMPILER_WORKS TRUE )
57 return ()
68endif ()
79
8- set (CMAKE_ISPC_COMPILER_WORKS 1 CACHE INTERNAL "" )
10+ set (CMAKE_ISPC_COMPILER_WORKS
11+ 1
12+ CACHE INTERNAL "" )
913
10- # Remove any cached result from an older CMake version.
11- # We now store this in CMakeISPCCompiler.cmake.
14+ # Remove any cached result from an older CMake version. We now store this in
15+ # CMakeISPCCompiler.cmake.
1216unset (CMAKE_ISPC_COMPILER_WORKS CACHE )
1317
14- # This file is used by EnableLanguage in cmGlobalGenerator to
15- # determine that the selected ispc compiler can actually compile
16- # and the most basic program. If not, a fatal error
17- # is set and cmake stops processing commands and will not generate
18- # any makefiles or projects.
18+ # ~~~
19+ # This file is used by EnableLanguage in cmGlobalGenerator to determine that the selected
20+ # ispc compiler can actually compile and the most basic program. If not, a fatal error is
21+ # set and cmake stops processing commands and will not generate any makefiles or projects.
22+ # ~~~
1923if (NOT CMAKE_ISPC_COMPILER_WORKS)
20- PrintTestCompilerStatus ("ISPC" "" )
24+ printtestcompilerstatus ("ISPC" "" )
2125 file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeTmp/kernel.ispc
22- "export uniform int kernel(uniform int){return 0;}\n " )
26+ "export uniform int kernel(uniform int){return 0;}\n " )
2327
24- execute_process (COMMAND ${CMAKE_ISPC_COMPILER} "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeTmp/kernel.ispc"
25- OUTPUT_VARIABLE __CMAKE_ISPC_COMPILER_OUTPUT
26- ERROR_VARIABLE __CMAKE_ISPC_COMPILER_ERROR
27- RESULT_VARIABLE ISPC_RESULT)
28+ execute_process (
29+ COMMAND ${CMAKE_ISPC_COMPILER}
30+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeTmp/kernel.ispc"
31+ OUTPUT_VARIABLE __CMAKE_ISPC_COMPILER_OUTPUT
32+ ERROR_VARIABLE __CMAKE_ISPC_COMPILER_ERROR
33+ RESULT_VARIABLE ISPC_RESULT)
2834
2935 if (${ISPC_RESULT} )
3036 set (CMAKE_ISPC_COMPILER_WORKS 0)
@@ -37,25 +43,28 @@ if(NOT CMAKE_ISPC_COMPILER_WORKS)
3743 set (ISPC_TEST_WAS_RUN 1)
3844endif ()
3945
46+ # Print compiler status
4047if (NOT CMAKE_ISPC_COMPILER_WORKS)
41- PrintTestCompilerStatus ("ISPC" " -- broken" )
48+ printtestcompilerstatus ("ISPC" " -- broken" )
4249 file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeError.log
43- "Determining if the ISPC compiler works failed with "
44- "the following output:\n ${__CMAKE_ISPC_COMPILER_OUTPUT} \n\n " )
45- string (REPLACE "\n " "\n " _output "${__CMAKE_ISPC_COMPILER_OUTPUT} ${__CMAKE_ISPC_COMPILER_ERROR} " )
46- message (FATAL_ERROR "The ISPC compiler\n \" ${CMAKE_ISPC_COMPILER} \"\n "
47- "is not able to compile a simple test program.\n It fails "
48- "with the following output:\n ${_output} \n\n "
49- "CMake will not be able to correctly generate this project." )
50+ "Determining if the ISPC compiler works failed with "
51+ "the following output:\n ${__CMAKE_ISPC_COMPILER_OUTPUT} \n\n " )
52+ string (REPLACE "\n " "\n " _output
53+ "${__CMAKE_ISPC_COMPILER_OUTPUT} ${__CMAKE_ISPC_COMPILER_ERROR} " )
54+ message (
55+ FATAL_ERROR
56+ "The ISPC compiler\n \" ${CMAKE_ISPC_COMPILER} \"\n "
57+ "is not able to compile a simple test program.\n It fails "
58+ "with the following output:\n ${_output} \n\n "
59+ "CMake will not be able to correctly generate this project." )
5060else ()
5161 if (ISPC_TEST_WAS_RUN)
52- PrintTestCompilerStatus ("ISPC" " -- works" )
62+ printtestcompilerstatus ("ISPC" " -- works" )
5363 file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY} /CMakeOutput.log
54- "Determining if the ISPC compiler works passed with "
55- "the following output:\n ${__CMAKE_ISPC_COMPILER_OUTPUT} \n\n " )
64+ "Determining if the ISPC compiler works passed with "
65+ "the following output:\n ${__CMAKE_ISPC_COMPILER_OUTPUT} \n\n " )
5666 endif ()
5767endif ()
5868
59-
6069unset (__CMAKE_ISPC_COMPILER_OUTPUT)
6170unset (__CMAKE_ISPC_COMPILER_ERROR)
0 commit comments