This is an automated email from the ASF dual-hosted git repository.
serverglen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 5d32732c support with_snappy in cmake
new eb6d65b5 Merge pull request #1799 from renzhong/cmake_snappy
5d32732c is described below
commit 5d32732c6884a95b66c1e850c5e3c9b38443b11b
Author: devin.zhang <[email protected]>
AuthorDate: Thu Jun 16 17:17:45 2022 +0800
support with_snappy in cmake
---
CMakeLists.txt | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 057695af..1bd7c939 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,7 @@ option(WITH_MESALINK "With MesaLink" OFF)
option(DEBUG "Print debug logs" OFF)
option(WITH_DEBUG_SYMBOLS "With debug symbols" ON)
option(WITH_THRIFT "With thrift framed protocol supported" OFF)
+option(WITH_SNAPPY "With snappy" OFF)
option(BUILD_UNIT_TESTS "Whether to build unit tests" OFF)
option(DOWNLOAD_GTEST "Download and build a fresh copy of googletest. Requires
Internet access." ON)
@@ -151,6 +152,15 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message(FATAL_ERROR "Fail to find leveldb")
endif()
+if(WITH_SNAPPY)
+ find_path(SNAPPY_INCLUDE_PATH NAMES snappy.h)
+ find_library(SNAPPY_LIB NAMES snappy)
+ if ((NOT SNAPPY_INCLUDE_PATH) OR (NOT SNAPPY_LIB))
+ message(FATAL_ERROR "Fail to find snappy")
+ endif()
+ include_directories(${SNAPPY_INCLUDE_PATH})
+endif()
+
if(WITH_GLOG)
find_path(GLOG_INCLUDE_PATH NAMES glog/logging.h)
find_library(GLOG_LIB NAMES glog)
@@ -216,6 +226,11 @@ if(WITH_GLOG)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog")
endif()
+if(WITH_SNAPPY)
+ set(DYNAMIC_LIB ${DYNAMIC_LIB} ${SNAPPY_LIB})
+ set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lsnappy")
+endif()
+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DYNAMIC_LIB ${DYNAMIC_LIB} rt)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lrt")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]