2023-04-18 07:33:49 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-10-03 07:03:31 +08:00
|
|
|
index 5eea37c..145e5b6 100644
|
2023-04-18 07:33:49 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-10-03 07:03:31 +08:00
|
|
|
@@ -96,23 +96,25 @@ endif ()
|
2023-04-18 07:33:49 +08:00
|
|
|
|
|
|
|
# Find required dependencies for thrift/lib
|
2023-06-01 03:24:33 +08:00
|
|
|
if (THRIFT_LIB_ONLY OR build_all)
|
2023-04-18 07:33:49 +08:00
|
|
|
- find_package(Gflags REQUIRED)
|
|
|
|
+ find_package(gflags CONFIG REQUIRED)
|
|
|
|
+ set(LIBGFLAGS_LIBRARY gflags::gflags)
|
|
|
|
find_package(glog CONFIG REQUIRED)
|
|
|
|
set (GLOG_LIBRARIES glog::glog)
|
|
|
|
find_package(folly CONFIG REQUIRED)
|
2023-06-01 03:24:33 +08:00
|
|
|
find_package(fizz CONFIG REQUIRED)
|
2023-04-18 07:33:49 +08:00
|
|
|
find_package(wangle CONFIG REQUIRED)
|
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
- find_package(Zstd REQUIRED)
|
|
|
|
+ find_package(zstd CONFIG REQUIRED)
|
|
|
|
+ if(TARGET zstd::libzstd_shared)
|
|
|
|
+ set(ZSTD_LIBRARIES zstd::libzstd_shared)
|
|
|
|
+ elseif(TARGET zstd::libzstd_static)
|
|
|
|
+ set(ZSTD_LIBRARIES zstd::libzstd_static)
|
|
|
|
+ endif()
|
2023-10-03 07:03:31 +08:00
|
|
|
find_package(mvfst CONFIG REQUIRED)
|
2023-04-18 07:33:49 +08:00
|
|
|
# https://cmake.org/cmake/help/v3.9/module/FindThreads.html
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads)
|
|
|
|
include_directories(
|
|
|
|
- ${LIBGFLAGS_INCLUDE_DIR}
|
|
|
|
- ${GLOG_INCLUDE_DIRS}
|
|
|
|
- ${OPENSSL_INCLUDE_DIR}
|
|
|
|
- ${ZSTD_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
add_definitions("-DTHRIFT_HAVE_LIBSNAPPY=0")
|
2023-06-01 03:24:33 +08:00
|
|
|
if (THRIFT_LIB_ONLY)
|
2023-04-18 07:33:49 +08:00
|
|
|
diff --git a/thrift/cmake/FBThriftConfig.cmake.in b/thrift/cmake/FBThriftConfig.cmake.in
|
2023-10-03 07:03:31 +08:00
|
|
|
index 1d38221..ab96215 100644
|
2023-04-18 07:33:49 +08:00
|
|
|
--- a/thrift/cmake/FBThriftConfig.cmake.in
|
|
|
|
+++ b/thrift/cmake/FBThriftConfig.cmake.in
|
2023-10-03 07:03:31 +08:00
|
|
|
@@ -28,8 +28,15 @@ else()
|
2023-04-18 07:33:49 +08:00
|
|
|
set_and_check(FBTHRIFT_COMPILER "@PACKAGE_BIN_INSTALL_DIR@/thrift1")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
-find_dependency(ZLIB REQUIRED)
|
2023-10-03 07:03:31 +08:00
|
|
|
-find_package(mvfst CONFIG REQUIRED)
|
|
|
|
+find_dependency(ZLIB)
|
|
|
|
+find_dependency(mvfst CONFIG)
|
2023-04-18 07:33:49 +08:00
|
|
|
+find_dependency(fizz CONFIG )
|
|
|
|
+find_dependency(fmt CONFIG )
|
|
|
|
+find_dependency(folly CONFIG )
|
|
|
|
+find_dependency(gflags CONFIG)
|
|
|
|
+find_dependency(glog CONFIG )
|
|
|
|
+find_dependency(wangle CONFIG )
|
|
|
|
+find_dependency(zstd CONFIG)
|
|
|
|
|
|
|
|
if (NOT TARGET FBThrift::thriftcpp2)
|
|
|
|
include("${FBTHRIFT_CMAKE_DIR}/FBThriftTargets.cmake")
|