summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Apple-IntelLLVM-C.cmake2
-rw-r--r--Modules/Platform/Apple-IntelLLVM-CXX.cmake2
-rw-r--r--Modules/Platform/Apple-IntelLLVM-Fortran.cmake8
-rw-r--r--Modules/Platform/Apple-IntelLLVM.cmake17
-rw-r--r--Modules/Platform/Linux-IntelLLVM-C.cmake3
-rw-r--r--Modules/Platform/Linux-IntelLLVM-CXX.cmake3
-rw-r--r--Modules/Platform/Linux-IntelLLVM-Fortran.cmake4
-rw-r--r--Modules/Platform/Linux-IntelLLVM.cmake55
-rw-r--r--Modules/Platform/Windows-IntelLLVM-ASM.cmake2
-rw-r--r--Modules/Platform/Windows-IntelLLVM-C.cmake2
-rw-r--r--Modules/Platform/Windows-IntelLLVM-CXX.cmake3
-rw-r--r--Modules/Platform/Windows-IntelLLVM-Fortran.cmake44
-rw-r--r--Modules/Platform/Windows-IntelLLVM.cmake17
13 files changed, 162 insertions, 0 deletions
diff --git a/Modules/Platform/Apple-IntelLLVM-C.cmake b/Modules/Platform/Apple-IntelLLVM-C.cmake
new file mode 100644
index 0000000..8e74729
--- /dev/null
+++ b/Modules/Platform/Apple-IntelLLVM-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-IntelLLVM)
+__apple_compiler_intel_llvm(C)
diff --git a/Modules/Platform/Apple-IntelLLVM-CXX.cmake b/Modules/Platform/Apple-IntelLLVM-CXX.cmake
new file mode 100644
index 0000000..38640e1
--- /dev/null
+++ b/Modules/Platform/Apple-IntelLLVM-CXX.cmake
@@ -0,0 +1,2 @@
+include(Platform/Apple-IntelLLVM)
+__apple_compiler_intel_llvm(CXX)
diff --git a/Modules/Platform/Apple-IntelLLVM-Fortran.cmake b/Modules/Platform/Apple-IntelLLVM-Fortran.cmake
new file mode 100644
index 0000000..d0486ed
--- /dev/null
+++ b/Modules/Platform/Apple-IntelLLVM-Fortran.cmake
@@ -0,0 +1,8 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+include(Platform/Apple-IntelLLVM)
+__apple_compiler_intel_llvm(Fortran)
+
+set(CMAKE_Fortran_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
+set(CMAKE_Fortran_OSX_CURRENT_VERSION_FLAG "-current_version ")
diff --git a/Modules/Platform/Apple-IntelLLVM.cmake b/Modules/Platform/Apple-IntelLLVM.cmake
new file mode 100644
index 0000000..2f9f0ca
--- /dev/null
+++ b/Modules/Platform/Apple-IntelLLVM.cmake
@@ -0,0 +1,17 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# This module is shared by multiple languages; use include blocker.
+include_guard()
+
+macro(__apple_compiler_intel_llvm lang)
+ set(CMAKE_${lang}_VERBOSE_FLAG "-v -Wl,-v") # also tell linker to print verbose output
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+ set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
+
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
+
+ set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endmacro()
diff --git a/Modules/Platform/Linux-IntelLLVM-C.cmake b/Modules/Platform/Linux-IntelLLVM-C.cmake
new file mode 100644
index 0000000..5356c4f
--- /dev/null
+++ b/Modules/Platform/Linux-IntelLLVM-C.cmake
@@ -0,0 +1,3 @@
+include(Platform/Linux-IntelLLVM)
+__linux_compiler_intel_llvm(C)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
diff --git a/Modules/Platform/Linux-IntelLLVM-CXX.cmake b/Modules/Platform/Linux-IntelLLVM-CXX.cmake
new file mode 100644
index 0000000..44ce0e8
--- /dev/null
+++ b/Modules/Platform/Linux-IntelLLVM-CXX.cmake
@@ -0,0 +1,3 @@
+include(Platform/Linux-IntelLLVM)
+__linux_compiler_intel_llvm(CXX)
+set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
diff --git a/Modules/Platform/Linux-IntelLLVM-Fortran.cmake b/Modules/Platform/Linux-IntelLLVM-Fortran.cmake
new file mode 100644
index 0000000..1cd9b1f
--- /dev/null
+++ b/Modules/Platform/Linux-IntelLLVM-Fortran.cmake
@@ -0,0 +1,4 @@
+include(Platform/Linux-IntelLLVM)
+__linux_compiler_intel_llvm(Fortran)
+string(APPEND CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS " -nofor-main")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "")
diff --git a/Modules/Platform/Linux-IntelLLVM.cmake b/Modules/Platform/Linux-IntelLLVM.cmake
new file mode 100644
index 0000000..1363b44
--- /dev/null
+++ b/Modules/Platform/Linux-IntelLLVM.cmake
@@ -0,0 +1,55 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# This module is shared by multiple languages; use include blocker.
+if(__LINUX_COMPILER_INTEL_LLVM)
+ return()
+endif()
+set(__LINUX_COMPILER_INTEL_LLVM 1)
+
+if(NOT XIAR)
+ set(_intel_xiar_hints)
+ foreach(lang C CXX Fortran)
+ if(IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}")
+ get_filename_component(_hint "${CMAKE_${lang}_COMPILER}" PATH)
+ list(APPEND _intel_xiar_hints ${_hint})
+ endif()
+ endforeach()
+ find_program(XIAR NAMES xiar HINTS ${_intel_xiar_hints})
+ mark_as_advanced(XIAR)
+endif()
+
+macro(__linux_compiler_intel_llvm lang)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
+
+ # We pass this for historical reasons. Projects may have
+ # executables that use dlopen but do not set ENABLE_EXPORTS.
+ set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
+
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
+
+ set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
+
+ if(XIAR)
+ # INTERPROCEDURAL_OPTIMIZATION
+ set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -ipo)
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY_IPO
+ "${XIAR} cr <TARGET> <LINK_FLAGS> <OBJECTS> "
+ "${XIAR} -s <TARGET> ")
+ set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+ set(_CMAKE_${lang}_IPO_LEGACY_BEHAVIOR YES)
+ else()
+ set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
+ endif()
+
+ set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+endmacro()
diff --git a/Modules/Platform/Windows-IntelLLVM-ASM.cmake b/Modules/Platform/Windows-IntelLLVM-ASM.cmake
new file mode 100644
index 0000000..f355e49
--- /dev/null
+++ b/Modules/Platform/Windows-IntelLLVM-ASM.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-IntelLLVM)
+__windows_compiler_intel(ASM)
diff --git a/Modules/Platform/Windows-IntelLLVM-C.cmake b/Modules/Platform/Windows-IntelLLVM-C.cmake
new file mode 100644
index 0000000..93c3364
--- /dev/null
+++ b/Modules/Platform/Windows-IntelLLVM-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-IntelLLVM)
+__windows_compiler_intel(C)
diff --git a/Modules/Platform/Windows-IntelLLVM-CXX.cmake b/Modules/Platform/Windows-IntelLLVM-CXX.cmake
new file mode 100644
index 0000000..4667895
--- /dev/null
+++ b/Modules/Platform/Windows-IntelLLVM-CXX.cmake
@@ -0,0 +1,3 @@
+include(Platform/Windows-IntelLLVM)
+set(_COMPILE_CXX " /TP")
+__windows_compiler_intel(CXX)
diff --git a/Modules/Platform/Windows-IntelLLVM-Fortran.cmake b/Modules/Platform/Windows-IntelLLVM-Fortran.cmake
new file mode 100644
index 0000000..06d0a00
--- /dev/null
+++ b/Modules/Platform/Windows-IntelLLVM-Fortran.cmake
@@ -0,0 +1,44 @@
+include(Platform/Windows-IntelLLVM)
+set(CMAKE_BUILD_TYPE_INIT Debug)
+set(_COMPILE_Fortran " /fpp")
+set(CMAKE_Fortran_MODDIR_FLAG "-module:")
+set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib")
+__windows_compiler_intel(Fortran)
+if(CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT)
+ set(_LIBSDLL "")
+ set(_DBGLIBS "")
+ set(_THREADS "")
+else()
+ set(_LIBSDLL " /libs:dll")
+ set(_DBGLIBS " /dbglibs")
+ set(_THREADS " /threads")
+endif()
+
+cmake_policy(GET CMP0092 _cmp0092)
+if(NOT _cmp0092 STREQUAL "NEW")
+ string(APPEND CMAKE_Fortran_FLAGS_INIT " /W1")
+endif()
+unset(_cmp0092)
+
+string(APPEND CMAKE_Fortran_FLAGS_INIT " /nologo /fpp${_LIBSDLL}${_THREADS}")
+string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " /Od /debug:full${_DBGLIBS}")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " /O1 /DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " /O2 /DNDEBUG")
+string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " /O2 /debug:full /DNDEBUG")
+unset(_LIBSDLL)
+unset(_DBGLIBS)
+unset(_THREADS)
+
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -threads -libs:static)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -threads -libs:dll)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -threads -libs:static -dbglibs)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -threads -libs:dll -dbglibs)
+
+# Intel Fortran for Windows supports single-threaded RTL but it is
+# not implemented by the Visual Studio integration.
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreaded -libs:static)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDLL -libs:dll)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDebug -libs:static -dbglibs)
+ set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_SingleThreadedDebugDLL -libs:dll -dbglibs)
+endif()
diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake
new file mode 100644
index 0000000..b9ea037
--- /dev/null
+++ b/Modules/Platform/Windows-IntelLLVM.cmake
@@ -0,0 +1,17 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+
+# This module is shared by multiple languages; use include blocker.
+if(__WINDOWS_INTEL)
+ return()
+endif()
+set(__WINDOWS_INTEL 1)
+
+include(Platform/Windows-MSVC)
+macro(__windows_compiler_intel lang)
+ __windows_compiler_msvc(${lang})
+
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
+ set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
+endmacro()