[libcxx-commits] [PATCH] D60276: [libc++] Localize CMake code only related to the shared library
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Apr 6 12:19:37 PDT 2019
mstorsjo added inline comments.
================
Comment at: lib/CMakeLists.txt:179
+ else()
+ target_link_libraries(cxx_shared PRIVATE "-Wl,--whole-archive,-Bstatic" "$<TARGET_LINKER_FILE:${LIBCXX_CXX_STATIC_ABI_LIBRARY}>" "-Wl,-Bdynamic,--no-whole-archive")
+ endif()
----------------
This broke my compilation of libcxx for mingw (where I statically link in libc++abi into it), with the following error:
```
CMake Error at lib/CMakeLists.txt:179 (target_link_libraries):
Error evaluating generator expression:
$<TARGET_LINKER_FILE:c++abi>
No target "c++abi"
```
I'm not really familiar enough with this aspect of CMake to know what is wrong here and what's expected. Prior to this patch, the corresponding code elsewhere in the same CMakeLists.txt did this:
```
add_library_flags("-Wl,--whole-archive" "-Wl,-Bstatic")
add_library_flags("${LIBCXX_CXX_STATIC_ABI_LIBRARY}")
add_library_flags("-Wl,-Bdynamic" "-Wl,--no-whole-archive")
```
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60276/new/
https://reviews.llvm.org/D60276
More information about the libcxx-commits
mailing list