From 9fcd82e98780894d8a26916391a53f3a6850e226 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 15 Apr 2018 13:14:26 -0700 Subject: [PATCH] cmake: append rados to THIRDPARTY_LIBS before appending it to LIBS Summary: otherwise the env_librados_test executable will fail to link against librados. Signed-off-by: Kefu Chai Closes https://github.com/facebook/rocksdb/pull/3724 Differential Revision: D7631542 Pulled By: ajkr fbshipit-source-id: 38afbf21f9aeb7dedfb840aba8b2f8b421f9edb0 --- CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18f896944..1d9dfd7a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -677,6 +677,14 @@ endif() set(ROCKSDB_STATIC_LIB rocksdb${ARTIFACT_SUFFIX}) set(ROCKSDB_SHARED_LIB rocksdb-shared${ARTIFACT_SUFFIX}) set(ROCKSDB_IMPORT_LIB ${ROCKSDB_SHARED_LIB}) + +option(WITH_LIBRADOS "Build with librados" OFF) +if(WITH_LIBRADOS) + list(APPEND SOURCES + utilities/env_librados.cc) + list(APPEND THIRDPARTY_LIBS rados) +endif() + if(WIN32) set(SYSTEM_LIBS ${SYSTEM_LIBS} Shlwapi.lib Rpcrt4.lib) set(LIBS ${ROCKSDB_STATIC_LIB} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS}) @@ -695,13 +703,6 @@ else() OUTPUT_NAME "rocksdb") endif() -option(WITH_LIBRADOS "Build with librados" OFF) -if(WITH_LIBRADOS) - list(APPEND SOURCES - utilities/env_librados.cc) - list(APPEND THIRDPARTY_LIBS rados) -endif() - add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES}) target_link_libraries(${ROCKSDB_STATIC_LIB} ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})