summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-07-16 19:18:55 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2020-08-28 15:21:31 (GMT)
commit34cc6acc81758e29f8c88607c21ab11d8807f87c (patch)
tree38effcd493f057f6148f4d8f58262dfb27afaa24 /Modules/CMakeDetermineCompilerId.cmake
parent419d70d49000e10c36d9615574ff03513f2edf0d (diff)
downloadCMake-34cc6acc81758e29f8c88607c21ab11d8807f87c.zip
CMake-34cc6acc81758e29f8c88607c21ab11d8807f87c.tar.gz
CMake-34cc6acc81758e29f8c88607c21ab11d8807f87c.tar.bz2
Add ISPC compiler support to CMake
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index d7a35e1..8724ed8 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -110,6 +110,28 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
endif()
+ # For ISPC we need to explicitly query the version.
+ if(lang STREQUAL "ISPC"
+ AND CMAKE_${lang}_COMPILER
+ AND NOT CMAKE_${lang}_COMPILER_VERSION)
+ execute_process(
+ COMMAND "${CMAKE_${lang}_COMPILER}"
+ --version
+ OUTPUT_VARIABLE output ERROR_VARIABLE output
+ RESULT_VARIABLE result
+ TIMEOUT 10
+ )
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" -version\n"
+ "${output}\n"
+ )
+
+ if(output MATCHES [[ISPC\), ([0-9]+\.[0-9]+(\.[0-9]+)?)]])
+ set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+
+
if (COMPILER_QNXNTO AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
execute_process(
COMMAND "${CMAKE_${lang}_COMPILER}"