From 07204837ce8d66e1e6e4893178f3fd040f9c1044 Mon Sep 17 00:00:00 2001 From: Tongliang Liao Date: Tue, 12 May 2020 21:05:50 -0700 Subject: [PATCH] Mark dependencies as PRIVATE and fix missing dependencies in tools. (#6790) Summary: Tools were mistakenly using leaked (PUBLIC) dependencies from main lib. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6790 Reviewed By: riversand963 Differential Revision: D21471551 fbshipit-source-id: ec43b92e231777e0fcf0f865444391af09d6963b --- CMakeLists.txt | 4 ++-- db_stress_tool/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aef2c6b5f..e631153d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -853,12 +853,12 @@ else() endif() add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES}) -target_link_libraries(${ROCKSDB_STATIC_LIB} +target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) if(ROCKSDB_BUILD_SHARED) add_library(${ROCKSDB_SHARED_LIB} SHARED ${SOURCES}) - target_link_libraries(${ROCKSDB_SHARED_LIB} + target_link_libraries(${ROCKSDB_SHARED_LIB} PRIVATE ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) if(WIN32) diff --git a/db_stress_tool/CMakeLists.txt b/db_stress_tool/CMakeLists.txt index 219a5a754..f698b34ce 100644 --- a/db_stress_tool/CMakeLists.txt +++ b/db_stress_tool/CMakeLists.txt @@ -10,5 +10,5 @@ add_executable(db_stress${ARTIFACT_SUFFIX} db_stress_gflags.cc db_stress_tool.cc no_batched_ops_stress.cc) -target_link_libraries(db_stress${ARTIFACT_SUFFIX} ${ROCKSDB_LIB}) +target_link_libraries(db_stress${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} ${THIRDPARTY_LIBS}) list(APPEND tool_deps db_stress) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 4a4b0bcda..19030e84b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -20,7 +20,7 @@ if(WITH_TOOLS) get_filename_component(exename ${src} NAME_WE) add_executable(${exename}${ARTIFACT_SUFFIX} ${src}) - target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB}) + target_link_libraries(${exename}${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} ${THIRDPARTY_LIBS}) list(APPEND tool_deps ${exename}) endforeach()