[libcxx-commits] [PATCH] D155560: [libcxx] Allow linking against the MSVC static CRT

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 19 14:33:45 PDT 2023


mstorsjo added a comment.

In D155560#4515688 <https://reviews.llvm.org/D155560#4515688>, @andrewng wrote:

> Actually, whilst looking at D155561 <https://reviews.llvm.org/D155561>, I see what you mean by duplication in the test configs. AFAICT, they only differ in the definitions in the `compile_flags`. I guess it would be good to somehow avoid all this duplication.

Yep. I don’t mind changing it, either in this patch or as a separate later follow-up, to running this logic in cmake and exporting the variables needed in the test config - I’ll leave that call up to the libcxx maintainers.

In D155560#4515188 <https://reviews.llvm.org/D155560#4515188>, @andrewng wrote:

> although I slightly prefer my patch where it would be possible to build both the shared and static versions of `libcxx`. However, this patch is more simple which is good too.

Yeah, this is very simple at least. If strictly needed, we can add options later. But due to the dllimport attributes in headers, you can’t really use a build of both static and shared anyway, unless users define the macro for disabling visibility before including libcxx headers. So with clang-cl, you pretty much need to choose either static or shared, not both. And at that point, the single variable `CMAKE_MSVC_RUNTIME_LIBRARY` gives enough control anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155560/new/

https://reviews.llvm.org/D155560



More information about the libcxx-commits mailing list