[libcxx-commits] [PATCH] D155555: [libcxx] Link to fewer MSVC CRT libraries

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 18 00:42:19 PDT 2023


mstorsjo created this revision.
mstorsjo added reviewers: Mordante, jyknight, andrewng.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

The library msvcrt.lib pulls in ucrt.lib and vcruntime.lib anyway,
there's no need to manually link against the individual dependencies.

This matches how the tests link against libraries - they only link
against msvcrt and msvcprt, not directly against ucrt and vcruntime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155555

Files:
  libcxx/CMakeLists.txt


Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -711,8 +711,6 @@
       set(LIB_SUFFIX "")
     endif()
 
-    target_link_libraries(${target} PRIVATE ucrt${LIB_SUFFIX}) # Universal C runtime
-    target_link_libraries(${target} PRIVATE vcruntime${LIB_SUFFIX}) # C++ runtime
     target_link_libraries(${target} PRIVATE msvcrt${LIB_SUFFIX}) # C runtime startup files
     target_link_libraries(${target} PRIVATE msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals.
     # Required for standards-complaint wide character formatting functions


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155555.541361.patch
Type: text/x-patch
Size: 676 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230718/48c71997/attachment.bin>


More information about the libcxx-commits mailing list