From 8218aed118f3d84b011f8b87385704a8cd603d3d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 15 Aug 2023 12:36:00 -0400 Subject: IntelLLVM: support marking include paths as SYSTEM directories Also learn how to suppress warnings when possible. See: https://discourse.cmake.org/t/icx-on-windows-supports-external-i/8739 --- Help/release/dev/IntelLLVM-isystem-flag.rst | 6 ++++++ Modules/Compiler/IntelLLVM.cmake | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 Help/release/dev/IntelLLVM-isystem-flag.rst diff --git a/Help/release/dev/IntelLLVM-isystem-flag.rst b/Help/release/dev/IntelLLVM-isystem-flag.rst new file mode 100644 index 0000000..bba3d26 --- /dev/null +++ b/Help/release/dev/IntelLLVM-isystem-flag.rst @@ -0,0 +1,6 @@ +IntelLLVM-isystem-flag +---------------------- + +* The :generator:`Ninja` and :generator:`NMake Makefiles` generators now use + the ``-external:I`` flag for system includes when using IntelLLVM as of + version 2021.4. The ``-external:W0`` flag is also used as of version 2022.2. diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake index f3c0bf4..a58128a 100644 --- a/Modules/Compiler/IntelLLVM.cmake +++ b/Modules/Compiler/IntelLLVM.cmake @@ -36,6 +36,12 @@ if(CMAKE_HOST_WIN32) __compiler_intel_llvm_common(${lang}) set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Qipo") set(CMAKE_${lang}_LINK_OPTIONS_IPO "-Qipo") + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2021.4") + set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-external:I") + if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2022.2") + set(_CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNING "-external:W0 ") + endif () + endif () endmacro() else() # GNU-like -- cgit v0.12