mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
176 lines
5.1 KiB
Diff
176 lines
5.1 KiB
Diff
|
diff --git a/fizz/CMakeLists.txt b/fizz/CMakeLists.txt
|
||
|
index 64bf93b..843b035 100644
|
||
|
--- a/fizz/CMakeLists.txt
|
||
|
+++ b/fizz/CMakeLists.txt
|
||
|
@@ -50,10 +50,9 @@ find_package(folly CONFIG REQUIRED)
|
||
|
find_package(fmt CONFIG REQUIRED)
|
||
|
|
||
|
find_package(OpenSSL REQUIRED)
|
||
|
-find_package(Glog REQUIRED)
|
||
|
-find_package(DoubleConversion REQUIRED)
|
||
|
+find_package(glog CONFIG REQUIRED)
|
||
|
+find_package(double-conversion CONFIG REQUIRED)
|
||
|
find_package(Threads REQUIRED)
|
||
|
-find_package(Zstd REQUIRED)
|
||
|
if (UNIX AND NOT APPLE)
|
||
|
find_package(Librt)
|
||
|
endif()
|
||
|
@@ -66,37 +65,17 @@ SET(FIZZ_SHINY_DEPENDENCIES "")
|
||
|
SET(FIZZ_LINK_LIBRARIES "")
|
||
|
SET(FIZZ_INCLUDE_DIRECTORIES "")
|
||
|
|
||
|
-find_package(gflags CONFIG QUIET)
|
||
|
-if (gflags_FOUND)
|
||
|
- message(STATUS "Found gflags from package config")
|
||
|
- if (TARGET gflags-shared)
|
||
|
- list(APPEND FIZZ_SHINY_DEPENDENCIES gflags-shared)
|
||
|
- elseif (TARGET gflags)
|
||
|
- list(APPEND FIZZ_SHINY_DEPENDENCIES gflags)
|
||
|
- else()
|
||
|
- message(FATAL_ERROR "Unable to determine the target name for the GFlags package.")
|
||
|
- endif()
|
||
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARIES})
|
||
|
- list(APPEND CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
|
||
|
-else()
|
||
|
- find_package(Gflags REQUIRED MODULE)
|
||
|
- list(APPEND FIZZ_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY})
|
||
|
- list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR})
|
||
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY})
|
||
|
- list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR})
|
||
|
+find_package(zstd CONFIG REQUIRED)
|
||
|
+if(TARGET zstd::libzstd_shared)
|
||
|
+ list(APPEND FIZZ_LINK_LIBRARIES zstd::libzstd_shared)
|
||
|
+elseif(TARGET zstd::libzstd_static)
|
||
|
+ list(APPEND FIZZ_LINK_LIBRARIES zstd::libzstd_static)
|
||
|
endif()
|
||
|
|
||
|
+find_package(gflags CONFIG REQUIRED)
|
||
|
find_package(ZLIB REQUIRED)
|
||
|
|
||
|
find_package(Libevent CONFIG REQUIRED)
|
||
|
-if(TARGET libevent::core)
|
||
|
- message(STATUS "Found libevent from package config")
|
||
|
- list(APPEND FIZZ_SHINY_DEPENDENCIES libevent::core)
|
||
|
-else()
|
||
|
- find_package(Libevent MODULE REQUIRED)
|
||
|
- list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB})
|
||
|
- list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
|
||
|
-endif()
|
||
|
|
||
|
set(FIZZ_HEADER_DIRS
|
||
|
client
|
||
|
@@ -237,30 +216,25 @@ target_include_directories(
|
||
|
PUBLIC
|
||
|
$<BUILD_INTERFACE:${FIZZ_BASE_DIR}>
|
||
|
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
|
||
|
- ${FOLLY_INCLUDE_DIR}
|
||
|
- ${OPENSSL_INCLUDE_DIR}
|
||
|
- ${sodium_INCLUDE_DIR}
|
||
|
- ${ZSTD_INCLUDE_DIR}
|
||
|
PRIVATE
|
||
|
- ${GLOG_INCLUDE_DIRS}
|
||
|
${FIZZ_INCLUDE_DIRECTORIES}
|
||
|
- ${DOUBLE_CONVERSION_INCLUDE_DIR}
|
||
|
)
|
||
|
|
||
|
|
||
|
target_link_libraries(fizz
|
||
|
PUBLIC
|
||
|
- ${FOLLY_LIBRARIES}
|
||
|
- ${OPENSSL_LIBRARIES}
|
||
|
+ Folly::folly
|
||
|
+ OpenSSL::SSL
|
||
|
+ OpenSSL::Crypto
|
||
|
unofficial-sodium::sodium
|
||
|
Threads::Threads
|
||
|
ZLIB::ZLIB
|
||
|
- ${ZSTD_LIBRARY}
|
||
|
PRIVATE
|
||
|
- ${GLOG_LIBRARIES}
|
||
|
- ${GFLAGS_LIBRARIES}
|
||
|
+ glog::glog
|
||
|
+ gflags::gflags
|
||
|
${FIZZ_LINK_LIBRARIES}
|
||
|
- ${DOUBLE_CONVERSION_LIBRARY}
|
||
|
+ libevent::core
|
||
|
+ double-conversion::double-conversion
|
||
|
${CMAKE_DL_LIBS}
|
||
|
${LIBRT_LIBRARIES})
|
||
|
|
||
|
@@ -317,8 +291,7 @@ ENDIF(CMAKE_CROSSCOMPILING)
|
||
|
SET(FIZZ_TEST_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||
|
|
||
|
if(BUILD_TESTS)
|
||
|
- find_package(GMock 1.8.0 MODULE REQUIRED)
|
||
|
- find_package(GTest 1.8.0 MODULE REQUIRED)
|
||
|
+ find_package(GTest CONFIG REQUIRED)
|
||
|
endif()
|
||
|
|
||
|
add_library(fizz_test_support
|
||
|
@@ -331,21 +304,9 @@ add_library(fizz_test_support
|
||
|
target_link_libraries(fizz_test_support
|
||
|
PUBLIC
|
||
|
fizz
|
||
|
- ${LIBGMOCK_LIBRARIES}
|
||
|
- ${GLOG_LIBRARY}
|
||
|
+ glog::glog
|
||
|
)
|
||
|
|
||
|
-target_compile_definitions(fizz_test_support
|
||
|
- PUBLIC
|
||
|
- ${LIBGMOCK_DEFINES}
|
||
|
-)
|
||
|
-
|
||
|
-target_include_directories(fizz_test_support
|
||
|
- SYSTEM
|
||
|
- PUBLIC
|
||
|
- ${LIBGMOCK_INCLUDE_DIR}
|
||
|
- ${LIBGTEST_INCLUDE_DIRS}
|
||
|
-)
|
||
|
|
||
|
# export fizz headers and targets for unit tests utils
|
||
|
# since other projects such as mvfst and proxygen use them
|
||
|
@@ -369,14 +330,13 @@ macro(add_gtest test_source test_name)
|
||
|
add_executable(${test_name} ${test_source} test/CMakeTestMain.cpp)
|
||
|
|
||
|
set_property(TARGET ${test_name} PROPERTY ENABLE_EXPORTS true)
|
||
|
- target_include_directories(
|
||
|
- ${test_name} PUBLIC ${LIBGMOCK_INCLUDE_DIR} ${LIBGTEST_INCLUDE_DIR})
|
||
|
- target_compile_definitions(${test_name} PUBLIC ${LIBGMOCK_DEFINES})
|
||
|
target_link_libraries(
|
||
|
${test_name}
|
||
|
fizz
|
||
|
fizz_test_support
|
||
|
- ${LIBGMOCK_LIBRARIES})
|
||
|
+ GTest::gtest
|
||
|
+ GTest::gmock
|
||
|
+ )
|
||
|
|
||
|
if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
||
|
# GMOCK_MOCK_METHOD() will complain otherwise
|
||
|
diff --git a/fizz/cmake/fizz-config.cmake.in b/fizz/cmake/fizz-config.cmake.in
|
||
|
index 3fb48b2..baa43a6 100644
|
||
|
--- a/fizz/cmake/fizz-config.cmake.in
|
||
|
+++ b/fizz/cmake/fizz-config.cmake.in
|
||
|
@@ -26,10 +26,19 @@ endif()
|
||
|
set(FIZZ_LIBRARIES fizz::fizz)
|
||
|
|
||
|
include(CMakeFindDependencyMacro)
|
||
|
-find_dependency(unofficial-sodium CONFIG REQUIRED)
|
||
|
+find_dependency(unofficial-sodium CONFIG)
|
||
|
find_dependency(folly CONFIG)
|
||
|
find_dependency(ZLIB)
|
||
|
find_dependency(Libevent CONFIG)
|
||
|
+find_dependency(fmt CONFIG)
|
||
|
+find_dependency(OpenSSL)
|
||
|
+find_dependency(glog CONFIG)
|
||
|
+find_dependency(double-conversion CONFIG)
|
||
|
+find_dependency(Threads)
|
||
|
+find_dependency(gflags CONFIG)
|
||
|
+find_dependency(zstd CONFIG)
|
||
|
+find_dependency(GTest CONFIG)
|
||
|
+
|
||
|
|
||
|
if (NOT fizz_FIND_QUIETLY)
|
||
|
message(STATUS "Found fizz: ${PACKAGE_PREFIX_DIR}")
|