[libcxx-commits] [PATCH] D60276: [libc++] Localize CMake code only related to the shared library

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 8 13:53:45 PDT 2019


ldionne marked an inline comment as done.
ldionne 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()
----------------
mstorsjo wrote:
> 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")
> ```
> 
How do you point the build to the static libc++abi? Is it not built in the tree?


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