summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/IntelLLVM-C.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-29 12:54:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-01-29 12:54:42 (GMT)
commit0e60ec7480a63ce596f3c6edf3624dc42dc87365 (patch)
tree6acbc1c181af9c713f8449cf11984c7f7b7a2c4d /Modules/Compiler/IntelLLVM-C.cmake
parent59b5b6e11c243e4d45e57caf939107ef9fc44c75 (diff)
parent9b5fd04905811ef5fcae740c9edbf5dca7db0511 (diff)
downloadCMake-0e60ec7480a63ce596f3c6edf3624dc42dc87365.zip
CMake-0e60ec7480a63ce596f3c6edf3624dc42dc87365.tar.gz
CMake-0e60ec7480a63ce596f3c6edf3624dc42dc87365.tar.bz2
Merge topic 'intel-llvm-compilers'
9b5fd04905 Tests: Disable MFC test for IntelLLVM due to #18311 ccdf7c0005 Tests: Skip VSGNUFortran test for ifx. ddaf412dd0 Tests: Skip per file PDBs in PDBDirectoryAndName for IntelLLVM a619b32768 Tests: Update RunCMake.GenerateExportHeader for IntelLLVM 661b04d6a6 Tests: Skip old PrecompiledHeader test on IntelLLVM 01b1e9c40d Tests: Update CompileFeatures test for IntelLLVM f26f10184f Tests: Update Module.WriteCompilerDetectionHeader for IntelLLVM 3ceb364b1c Tests: Update RunCMake.FileAPI for IntelLLVM ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5594
Diffstat (limited to 'Modules/Compiler/IntelLLVM-C.cmake')
-rw-r--r--Modules/Compiler/IntelLLVM-C.cmake63
1 files changed, 63 insertions, 0 deletions
diff --git a/Modules/Compiler/IntelLLVM-C.cmake b/Modules/Compiler/IntelLLVM-C.cmake
new file mode 100644
index 0000000..0ad2f0d
--- /dev/null
+++ b/Modules/Compiler/IntelLLVM-C.cmake
@@ -0,0 +1,63 @@
+include(Compiler/IntelLLVM)
+__compiler_intel_llvm(C)
+
+if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -TC)
+ set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+else()
+ set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+
+ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
+ string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
+ string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
+endif()
+
+set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
+set(CMAKE_C17_STANDARD__HAS_FULL_SUPPORT ON)
+
+if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
+
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
+
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
+
+ set(CMAKE_C17_STANDARD_COMPILE_OPTION "-std=c17")
+ set(CMAKE_C17_EXTENSION_COMPILE_OPTION "-std=gnu17")
+else()
+ # clang-cl doesn't have any of these
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION "")
+
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION "")
+
+ set(CMAKE_C11_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C11_EXTENSION_COMPILE_OPTION "")
+
+ set(CMAKE_C17_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C17_EXTENSION_COMPILE_OPTION "")
+endif()
+
+if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ __compiler_check_default_language_standard(C 2020 17)
+else()
+ set(CMAKE_C_STANDARD_DEFAULT "")
+endif()