mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 20:29:39 +08:00
[libc++] Use PRIVATE to link benchmark dependencies
It's better style to use PRIVATE when linking libraries to executables, and it doesn't make a difference since executables don't need to propagate their link-time dependencies anyway. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -135,16 +135,16 @@ function(add_benchmark_test name source_file)
|
|||||||
add_dependencies(${libcxx_target} cxx cxx-headers google-benchmark-libcxx)
|
add_dependencies(${libcxx_target} cxx cxx-headers google-benchmark-libcxx)
|
||||||
add_dependencies(cxx-benchmarks ${libcxx_target})
|
add_dependencies(cxx-benchmarks ${libcxx_target})
|
||||||
if (LIBCXX_ENABLE_SHARED)
|
if (LIBCXX_ENABLE_SHARED)
|
||||||
target_link_libraries(${libcxx_target} cxx_shared)
|
target_link_libraries(${libcxx_target} PRIVATE cxx_shared)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${libcxx_target} cxx_static)
|
target_link_libraries(${libcxx_target} PRIVATE cxx_static)
|
||||||
endif()
|
endif()
|
||||||
if (TARGET cxx_experimental)
|
if (TARGET cxx_experimental)
|
||||||
target_link_libraries(${libcxx_target} cxx_experimental)
|
target_link_libraries(${libcxx_target} PRIVATE cxx_experimental)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(${libcxx_target} -lbenchmark)
|
target_link_libraries(${libcxx_target} PRIVATE -lbenchmark)
|
||||||
if (LLVM_USE_SANITIZER)
|
if (LLVM_USE_SANITIZER)
|
||||||
target_link_libraries(${libcxx_target} -ldl)
|
target_link_libraries(${libcxx_target} PRIVATE -ldl)
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(${libcxx_target}
|
set_target_properties(${libcxx_target}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
@@ -161,14 +161,14 @@ function(add_benchmark_test name source_file)
|
|||||||
add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
|
add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
|
||||||
add_dependencies(${native_target} google-benchmark-native
|
add_dependencies(${native_target} google-benchmark-native
|
||||||
google-benchmark-libcxx)
|
google-benchmark-libcxx)
|
||||||
target_link_libraries(${native_target} -lbenchmark)
|
target_link_libraries(${native_target} PRIVATE -lbenchmark)
|
||||||
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
|
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
|
||||||
target_link_libraries(${native_target} ${LIBSTDCXX_FILESYSTEM_LIB})
|
target_link_libraries(${native_target} PRIVATE ${LIBSTDCXX_FILESYSTEM_LIB})
|
||||||
elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
|
elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
|
||||||
target_link_libraries(${native_target} -lc++fs -lc++experimental)
|
target_link_libraries(${native_target} PRIVATE -lc++fs -lc++experimental)
|
||||||
endif()
|
endif()
|
||||||
if (LIBCXX_HAS_PTHREAD_LIB)
|
if (LIBCXX_HAS_PTHREAD_LIB)
|
||||||
target_link_libraries(${native_target} -pthread)
|
target_link_libraries(${native_target} PRIVATE -pthread)
|
||||||
endif()
|
endif()
|
||||||
add_dependencies(cxx-benchmarks ${native_target})
|
add_dependencies(cxx-benchmarks ${native_target})
|
||||||
set_target_properties(${native_target}
|
set_target_properties(${native_target}
|
||||||
|
|||||||
Reference in New Issue
Block a user