From 57056bb60643e390c170ae3166d297a971587c93 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Fri, 1 Dec 2017 18:26:15 -0800 Subject: [PATCH] gflags in cmake on linux Summary: We should use it if available otherwise the tools builds never work. Thanks to #3212, we can set -DGFLAGS=1 and it'll be independent of the namespace with which gflags was compiled. Closes https://github.com/facebook/rocksdb/pull/3214 Differential Revision: D6462214 Pulled By: ajkr fbshipit-source-id: db4e5f1b905322e3119554a9d01b57532c499384 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99c4c4fd2..dbe47cf01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,6 +249,13 @@ if(WITH_UBSAN) endif() endif() +find_package(gflags) +if(gflags_FOUND) + add_definitions(-DGFLAGS=1) + include_directories(${gflags_INCLUDE_DIR}) + list(APPEND THIRDPARTY_LIBS ${gflags_LIBRARIES}) +endif() + find_package(NUMA) if(NUMA_FOUND) add_definitions(-DNUMA)