[PATCH] D128036: [CMake] Option to select C++ library for runtimes that use it

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 17 02:20:29 PDT 2022


mstorsjo accepted this revision.
mstorsjo added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: compiler-rt/CMakeLists.txt:534
+if (COMPILER_RT_CXX_LIBRARY STREQUAL "libcxx")
+  # We are using the in-tree libc++ so avoid including the default one.
+  append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ COMPILER_RT_COMMON_CFLAGS)
----------------
phosek wrote:
> mstorsjo wrote:
> > Does this mean that if you set `COMPILER_RT_CXX_LIBRARY=libcxx`, it's assumed that you're actually _building_ that same libcxx in the same cmake invocation?
> > 
> > I'm currently building compiler-rt in a standalone cmake invocation, separate from all the others, with `-DSANITIZER_CXX_ABI=libc++`. Building them all at once might be something I could consider at some point, but I wouldn't want to force that situation right now, if it could be avoided?
> Yes, correct. This is modeled after https://github.com/llvm/llvm-project/blob/610139d2d9ce6746b3c617fb3e2f7886272d26ff/libcxx/CMakeLists.txt#L230 and https://github.com/llvm/llvm-project/blob/610139d2d9ce6746b3c617fb3e2f7886272d26ff/libcxx/cmake/Modules/HandleLibCXXABI.cmake#L109.
> 
> In your case you'd likely want to use `-DCOMPILER_RT_CXX_LIBRARY=system-libcxx`.
Oh right, there was such an option too. Right, that'd work fine yeah - sorry for overlooking it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128036



More information about the cfe-commits mailing list