diff options
author | William R. Dieter <william.r.dieter@intel.com> | 2020-11-03 01:11:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-01-28 14:05:35 (GMT) |
commit | a90d2a9eed202b58b72776f9beb0569e92c90d21 (patch) | |
tree | afddec15f77981ca45cc32a56602dff010767535 /Modules/Platform/Windows-IntelLLVM-Fortran.cmake | |
parent | 9bef4bef0fbe69825f9103365a89be4696b6e1d0 (diff) | |
download | CMake-a90d2a9eed202b58b72776f9beb0569e92c90d21.zip CMake-a90d2a9eed202b58b72776f9beb0569e92c90d21.tar.gz CMake-a90d2a9eed202b58b72776f9beb0569e92c90d21.tar.bz2 |
IntelLLVM: Add support for Intel LLVM-based compilers
Using a single ID 'IntelLLVM' for the suite of Intel compilers based on
the LLVM backend. The 'IntelLLVM' ID are used for C, C++, and Fortran.
Data Parallel C++ will be handled in a separate commit.
The C and C++ definitions are based on the Clang definitions. The Intel
LLVM-based C and C++ compilers are based on the Clang front end, so
existing Clang options are more likely to be a good match than options
for the older Intel compilers.
Fortran is based on the older Fortran front end with the LLVM backend.
It has a similar interface to the older versions, though many options
are shared with the C and C++ compilers.
Fixes: #21561
Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
Diffstat (limited to 'Modules/Platform/Windows-IntelLLVM-Fortran.cmake')
-rw-r--r-- | Modules/Platform/Windows-IntelLLVM-Fortran.cmake | 44 |
1 files changed, 44 insertions, 0 deletions
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() |