Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit c788361

Browse files
committed
[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
1 parent f372cc7 commit c788361

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

benchmarks/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ function(add_benchmark_test name source_file)
135135
add_dependencies(${libcxx_target} cxx cxx-headers google-benchmark-libcxx)
136136
add_dependencies(cxx-benchmarks ${libcxx_target})
137137
if (LIBCXX_ENABLE_SHARED)
138-
target_link_libraries(${libcxx_target} cxx_shared)
138+
target_link_libraries(${libcxx_target} PRIVATE cxx_shared)
139139
else()
140-
target_link_libraries(${libcxx_target} cxx_static)
140+
target_link_libraries(${libcxx_target} PRIVATE cxx_static)
141141
endif()
142142
if (TARGET cxx_experimental)
143-
target_link_libraries(${libcxx_target} cxx_experimental)
143+
target_link_libraries(${libcxx_target} PRIVATE cxx_experimental)
144144
endif()
145-
target_link_libraries(${libcxx_target} -lbenchmark)
145+
target_link_libraries(${libcxx_target} PRIVATE -lbenchmark)
146146
if (LLVM_USE_SANITIZER)
147-
target_link_libraries(${libcxx_target} -ldl)
147+
target_link_libraries(${libcxx_target} PRIVATE -ldl)
148148
endif()
149149
set_target_properties(${libcxx_target}
150150
PROPERTIES
@@ -161,14 +161,14 @@ function(add_benchmark_test name source_file)
161161
add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file})
162162
add_dependencies(${native_target} google-benchmark-native
163163
google-benchmark-libcxx)
164-
target_link_libraries(${native_target} -lbenchmark)
164+
target_link_libraries(${native_target} PRIVATE -lbenchmark)
165165
if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")
166-
target_link_libraries(${native_target} ${LIBSTDCXX_FILESYSTEM_LIB})
166+
target_link_libraries(${native_target} PRIVATE ${LIBSTDCXX_FILESYSTEM_LIB})
167167
elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++")
168-
target_link_libraries(${native_target} -lc++fs -lc++experimental)
168+
target_link_libraries(${native_target} PRIVATE -lc++fs -lc++experimental)
169169
endif()
170170
if (LIBCXX_HAS_PTHREAD_LIB)
171-
target_link_libraries(${native_target} -pthread)
171+
target_link_libraries(${native_target} PRIVATE -pthread)
172172
endif()
173173
add_dependencies(cxx-benchmarks ${native_target})
174174
set_target_properties(${native_target}

0 commit comments

Comments
 (0)