summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-09 13:55:05 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-09 14:18:54 (GMT)
commitea0294c281b27b4aff968d94dda98989b0f16e39 (patch)
treef59606956bc861ccb4323ec67acd0fd99cc47344 /Modules/Platform
parent40bbe50e23c06232ccf1c49589dde5dd84e1ac31 (diff)
downloadCMake-ea0294c281b27b4aff968d94dda98989b0f16e39.zip
CMake-ea0294c281b27b4aff968d94dda98989b0f16e39.tar.gz
CMake-ea0294c281b27b4aff968d94dda98989b0f16e39.tar.bz2
Flang: Implement MSVC runtime library abstraction
In commit fb3370b6a1 (MSVC: Add abstraction for runtime library selection, 2019-04-10, v3.15.0-rc1~229^2) we overlooked updating flags for Flang on Windows. Add them now and update the MSVCRuntimeLibrary Fortran test to work with Flang. Base the flags on those we already use for the GNU-like Clang targeting the MSVC ABI. Fixes: #19583
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Windows-Flang-Fortran.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake
index a4b1cf1..c4420f7 100644
--- a/Modules/Platform/Windows-Flang-Fortran.cmake
+++ b/Modules/Platform/Windows-Flang-Fortran.cmake
@@ -1,3 +1,8 @@
include(Platform/Windows-MSVC)
__windows_compiler_msvc(Fortran)
set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang --dependent-lib=libcmt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -Xclang --dependent-lib=msvcrt)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -Xclang --dependent-lib=libcmtd)
+set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -Xclang --dependent-lib=msvcrtd)