From 887f3a88a679cc9a9811eac34ab7976e06ef5f78 Mon Sep 17 00:00:00 2001 From: Harini Chilamantula Date: Mon, 21 Sep 2020 14:33:23 -0700 Subject: Intel: Add Intel DPC++ compiler identification The compiler identifies itself with the `__INTEL_DPCPP_COMPILER__` preprocessor definition. --- Help/variable/CMAKE_LANG_COMPILER_ID.rst | 1 + Modules/CMakeCompilerIdDetection.cmake | 1 + Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100644 Modules/Compiler/IntelDPCPP-DetermineCompiler.cmake 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__)") -- cgit v0.12