[flang] [clang] [flang][windows] Add option to link against specific MSVC CRT (PR #70833)

Brad King via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 2 06:47:07 PDT 2023


================
@@ -281,3 +281,26 @@ add_flang_library(FortranRuntime
 
   INSTALL_WITH_TOOLCHAIN
 )
+
+if (DEFINED MSVC)
+  add_flang_library(FortranRuntime.static ${sources}
+    LINK_LIBS
+    FortranDecimal.static
+    INSTALL_WITH_TOOLCHAIN)
+  set_property(TARGET FortranRuntime.static PROPERTY MSVC_RUNTIME_LIBRARY MultiThreaded)
----------------
bradking wrote:

After local testing, it seems my earlier advice to set the `MSVC_RUNTIME_LIBRARY` property directly instead of using `CMAKE_MSVC_RUNTIME_LIBRARY` was incorrect.  LLVM's CMake infrastructure has options for using object libraries, in which case the compilation might not actually happen in the targets we name here.  Please switch back to the `set(CMAKE_MSVC_RUNTIME_LIBRARY ...)` pattern.

https://github.com/llvm/llvm-project/pull/70833


More information about the cfe-commits mailing list