[libcxx-commits] [libcxx] r373506 - [libc++] Revert to using PUBLIC instead of PRIVATE when linking system libs
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 2 12:11:08 PDT 2019
Author: ldionne
Date: Wed Oct 2 12:11:08 2019
New Revision: 373506
URL: http://llvm.org/viewvc/llvm-project?rev=373506&view=rev
Log:
[libc++] Revert to using PUBLIC instead of PRIVATE when linking system libs
It turns out the benchmarks need to link against those libraries
explicitly too, so CMake's propagation of PUBLIC dependencies is
used.
Modified:
libcxx/trunk/src/CMakeLists.txt
Modified: libcxx/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/CMakeLists.txt?rev=373506&r1=373505&r2=373506&view=diff
==============================================================================
--- libcxx/trunk/src/CMakeLists.txt (original)
+++ libcxx/trunk/src/CMakeLists.txt Wed Oct 2 12:11:08 2019
@@ -143,40 +143,40 @@ function(cxx_link_system_libraries targe
target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib")
if (LIBCXX_HAS_SYSTEM_LIB)
- target_link_libraries(${target} PRIVATE System)
+ target_link_libraries(${target} PUBLIC System)
endif()
if (LIBCXX_HAS_PTHREAD_LIB)
- target_link_libraries(${target} PRIVATE pthread)
+ target_link_libraries(${target} PUBLIC pthread)
endif()
if (LIBCXX_HAS_C_LIB)
- target_link_libraries(${target} PRIVATE c)
+ target_link_libraries(${target} PUBLIC c)
endif()
if (LIBCXX_HAS_M_LIB)
- target_link_libraries(${target} PRIVATE m)
+ target_link_libraries(${target} PUBLIC m)
endif()
if (LIBCXX_HAS_RT_LIB)
- target_link_libraries(${target} PRIVATE rt)
+ target_link_libraries(${target} PUBLIC rt)
endif()
if (LIBCXX_USE_COMPILER_RT)
find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
if (LIBCXX_BUILTINS_LIBRARY)
- target_link_libraries(${target} PRIVATE "${LIBCXX_BUILTINS_LIBRARY}")
+ target_link_libraries(${target} PUBLIC "${LIBCXX_BUILTINS_LIBRARY}")
endif()
elseif (LIBCXX_HAS_GCC_S_LIB)
- target_link_libraries(${target} PRIVATE gcc_s)
+ target_link_libraries(${target} PUBLIC gcc_s)
endif()
if (LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB)
- target_link_libraries(${target} PRIVATE atomic)
+ target_link_libraries(${target} PUBLIC atomic)
endif()
if (MINGW)
- target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+ target_link_libraries(${target} PUBLIC "${MINGW_LIBRARIES}")
endif()
if (LIBCXX_TARGETING_MSVC)
@@ -186,13 +186,13 @@ function(cxx_link_system_libraries targe
set(LIB_SUFFIX "")
endif()
- target_link_libraries(${target} PRIVATE ucrt${LIB_SUFFIX}) # Universal C runtime
- target_link_libraries(${target} PRIVATE vcruntime${LIB_SUFFIX}) # C++ runtime
- target_link_libraries(${target} PRIVATE msvcrt${LIB_SUFFIX}) # C runtime startup files
- target_link_libraries(${target} PRIVATE msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals.
+ target_link_libraries(${target} PUBLIC ucrt${LIB_SUFFIX}) # Universal C runtime
+ target_link_libraries(${target} PUBLIC vcruntime${LIB_SUFFIX}) # C++ runtime
+ target_link_libraries(${target} PUBLIC msvcrt${LIB_SUFFIX}) # C runtime startup files
+ target_link_libraries(${target} PUBLIC msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals.
# Required for standards-complaint wide character formatting functions
# (e.g. `printfw`/`scanfw`)
- target_link_libraries(${target} PRIVATE iso_stdio_wide_specifiers)
+ target_link_libraries(${target} PUBLIC iso_stdio_wide_specifiers)
endif()
endfunction()
More information about the libcxx-commits
mailing list