summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarini Chilamantula <harini.chilamantula@intel.com>2020-09-21 21:33:23 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-22 19:20:03 (GMT)
commit887f3a88a679cc9a9811eac34ab7976e06ef5f78 (patch)
tree05a536c1dd824a9d562ad391099e1c01be3c1709
parent0cb7216b9f016d5749209227502e499b53b33841 (diff)
downloadCMake-887f3a88a679cc9a9811eac34ab7976e06ef5f78.zip
CMake-887f3a88a679cc9a9811eac34ab7976e06ef5f78.tar.gz
CMake-887f3a88a679cc9a9811eac34ab7976e06ef5f78.tar.bz2
Intel: Add Intel DPC++ compiler identification
The compiler identifies itself with the `__INTEL_DPCPP_COMPILER__` preprocessor definition.
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst1
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake1
-rw-r--r--Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake7
3 files changed, 9 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 8eb4fb6..c495b71 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -25,6 +25,7 @@ include:
HP = Hewlett-Packard Compiler (hp.com)
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
+ IntelDPCPP = Intel DPCPP Compiler (intel.com)
MSVC = Microsoft Visual Studio (microsoft.com)
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index a0f0dfa..176e768 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -78,6 +78,7 @@ function(compiler_id_detection outvar lang)
ARMCC
AppleClang
ARMClang
+ IntelDPCPP
Clang
GNU
MSVC
diff --git a/Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake b/Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake
new file mode 100644
index 0000000..7bbb21c
--- /dev/null
+++ b/Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake
@@ -0,0 +1,7 @@
+
+set(_compiler_id_pp_test "defined(__clang__) && defined(__INTEL_DPCPP_COMPILER__)")
+
+include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake")
+
+string(APPEND _compiler_id_version_compute "
+# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_DPCPP_COMPILER__)")