[PATCH] D25008: [cmake] Split linked libraries into private & public, for linker script

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 16:35:46 PDT 2016


EricWF added inline comments.


================
Comment at: lib/CMakeLists.txt:41
+else()
+  list(APPEND LIBCXX_LIBRARIES_PUBLIC "${LIBCXX_CXX_ABI_LIBRARY}")
+endif()
----------------
Please handle the special case for Apple here, where it manually re-exports the ABI lib.


================
Comment at: lib/CMakeLists.txt:86
+elseif (LIBCXX_HAS_GCC_S_LIB)
+  list(APPEND LIBCXX_LIBRARIES_PUBLIC gcc_s)
+endif()
----------------
I don't think `libgcc_s` should be considered a public library like `libunwind` because both Clang and GCC link it as a default system library.


================
Comment at: lib/CMakeLists.txt:179
   add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
-  target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
+  target_link_libraries(cxx_static ${LIBCXX_LIBRARIES} ${LIBCXX_LIBRARIES_PUBLIC})
   set_target_properties(cxx_static
----------------
Should the libraries be added using `target_link_libraries(foo PRIVATE ...)` and `target_link_libraries(foo PUBLIC ...)` now? 


https://reviews.llvm.org/D25008





More information about the cfe-commits mailing list