summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-19 18:53:10 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-19 18:53:20 (GMT)
commit29488892e5c1cb2406d14389589e03c2d03006cf (patch)
tree59da30c4c44b35fc44c6062cc4480f6ce5575965 /Tests
parentc41c79285b5ebb7dd914a6e714aa553bb5078641 (diff)
parentea0294c281b27b4aff968d94dda98989b0f16e39 (diff)
downloadCMake-29488892e5c1cb2406d14389589e03c2d03006cf.zip
CMake-29488892e5c1cb2406d14389589e03c2d03006cf.tar.gz
CMake-29488892e5c1cb2406d14389589e03c2d03006cf.tar.bz2
Merge topic 'msvc-runtime-library-flang'
ea0294c281 Flang: Implement MSVC runtime library abstraction Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3674
Diffstat (limited to 'Tests')
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 169ba07..27838a4 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -6,9 +6,17 @@ foreach(t MultiThreaded SingleThreaded)
foreach(dbg "" Debug)
foreach(dll "" DLL)
set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
- # ifort does not actually define these, so inject them
- string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
- string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ # ifort does not actually define these, so inject them
+ string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
+ string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
+ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
+ # flang does not actually define these, so inject them
+ string(REPLACE ";--dependent-lib=libcmt;" ";--dependent-lib=libcmt;-D_MT;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrt;" ";--dependent-lib=msvcrt;-D_MT;-D_DLL;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=libcmtd;" ";--dependent-lib=libcmtd;-D_MT;-D_DEBUG;" "${var}" ";${${var}};")
+ string(REPLACE ";--dependent-lib=msvcrtd;" ";--dependent-lib=msvcrtd;-D_MT;-D_DEBUG;-D_DLL;" "${var}" ";${${var}};")
+ endif()
endforeach()
endforeach()
endforeach()
@@ -45,6 +53,6 @@ endfunction()
verify(Fortran verify.F90)
# 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")
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
verify_combinations(SingleThreaded Fortran verify.F90)
endif()