mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 03:01:39 +08:00
223 lines
7.4 KiB
Diff
223 lines
7.4 KiB
Diff
diff --git a/CMake/folly-config.cmake.in b/CMake/folly-config.cmake.in
|
|
index 0b96f0a10..ce7ce6b3f 100644
|
|
--- a/CMake/folly-config.cmake.in
|
|
+++ b/CMake/folly-config.cmake.in
|
|
@@ -29,10 +29,30 @@ endif()
|
|
set(FOLLY_LIBRARIES Folly::folly)
|
|
|
|
# Find folly's dependencies
|
|
-find_dependency(fmt)
|
|
+find_dependency(fmt CONFIG)
|
|
+find_dependency(double-conversion CONFIG)
|
|
+find_dependency(glog CONFIG)
|
|
+find_dependency(gflags CONFIG)
|
|
+find_dependency(Libevent CONFIG)
|
|
+if (NOT @CMAKE_DISABLE_FIND_PACKAGE_Zstd@)
|
|
+ find_dependency(zstd CONFIG)
|
|
+endif()
|
|
+if (@CMAKE_REQUIRE_FIND_PACKAGE_ZLIB@)
|
|
+ find_dependency(ZLIB MODULE)
|
|
+endif()
|
|
+find_dependency(OpenSSL MODULE)
|
|
+if (NOT @CMAKE_DISABLE_FIND_PACKAGE_unofficial-sodium@)
|
|
+ find_dependency(unofficial-sodium CONFIG)
|
|
+endif()
|
|
+if (NOT @CMAKE_DISABLE_FIND_PACKAGE_Snappy@)
|
|
+ find_dependency(Snappy CONFIG)
|
|
+endif()
|
|
+if (NOT @CMAKE_DISABLE_FIND_PACKAGE_LZ4@)
|
|
+ find_dependency(lz4 CONFIG)
|
|
+endif()
|
|
|
|
set(Boost_USE_STATIC_LIBS "@FOLLY_BOOST_LINK_STATIC@")
|
|
-find_dependency(Boost 1.51.0 MODULE
|
|
+find_dependency(Boost
|
|
COMPONENTS
|
|
context
|
|
filesystem
|
|
diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake
|
|
index d51f11128..776102d4d 100644
|
|
--- a/CMake/folly-deps.cmake
|
|
+++ b/CMake/folly-deps.cmake
|
|
@@ -35,7 +35,7 @@ else()
|
|
endif()
|
|
set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}")
|
|
|
|
-find_package(Boost 1.51.0 MODULE
|
|
+find_package(Boost
|
|
COMPONENTS
|
|
context
|
|
filesystem
|
|
@@ -45,40 +45,40 @@ find_package(Boost 1.51.0 MODULE
|
|
thread
|
|
REQUIRED
|
|
)
|
|
+set(Boost_LIBRARIES Boost::boost Boost::context Boost::filesystem Boost::program_options Boost::regex Boost::system Boost::thread)
|
|
list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
|
|
-
|
|
-find_package(DoubleConversion MODULE REQUIRED)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
|
|
|
|
find_package(FastFloat MODULE REQUIRED)
|
|
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${FASTFLOAT_INCLUDE_DIR})
|
|
|
|
-find_package(Gflags MODULE)
|
|
-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND})
|
|
-if(LIBGFLAGS_FOUND)
|
|
- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY})
|
|
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR})
|
|
- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY})
|
|
- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR})
|
|
-endif()
|
|
+find_package(double-conversion CONFIG REQUIRED)
|
|
+list(APPEND FOLLY_LINK_LIBRARIES double-conversion::double-conversion)
|
|
|
|
-find_package(Glog MODULE)
|
|
-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND})
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR})
|
|
+find_package(glog CONFIG REQUIRED)
|
|
+set(FOLLY_HAVE_LIBGLOG 1)
|
|
+list(APPEND FOLLY_LINK_LIBRARIES glog::glog)
|
|
|
|
-find_package(LibEvent MODULE REQUIRED)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
|
|
+find_package(gflags CONFIG)
|
|
+if(TARGET gflags::gflags)
|
|
+ set(FOLLY_HAVE_LIBGFLAGS 1)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES gflags::gflags)
|
|
+ set(FOLLY_LIBGFLAGS_LIBRARY gflags::gflags)
|
|
+endif()
|
|
|
|
-find_package(ZLIB MODULE)
|
|
-set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
|
|
-if (ZLIB_FOUND)
|
|
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
|
|
- list(APPEND FOLLY_LINK_LIBRARIES ${ZLIB_LIBRARIES})
|
|
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
|
|
+find_package(Libevent CONFIG REQUIRED)
|
|
+list(APPEND FOLLY_LINK_LIBRARIES libevent::core libevent::extra)
|
|
+if(NOT WIN32)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES libevent::pthreads)
|
|
+endif()
|
|
+
|
|
+if (CMAKE_REQUIRE_FIND_PACKAGE_ZLIB)
|
|
+ find_package(ZLIB MODULE REQUIRED)
|
|
+ set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
|
|
+ if (ZLIB_FOUND)
|
|
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES ${ZLIB_LIBRARIES})
|
|
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
|
|
+ endif()
|
|
endif()
|
|
|
|
find_package(OpenSSL 1.1.1 MODULE REQUIRED)
|
|
@@ -106,25 +106,29 @@ if (LIBLZMA_FOUND)
|
|
list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES})
|
|
endif()
|
|
|
|
-find_package(LZ4 MODULE)
|
|
-set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND})
|
|
-if (LZ4_FOUND)
|
|
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR})
|
|
- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY})
|
|
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_LZ4)
|
|
+ find_package(lz4 CONFIG)
|
|
+ if(TARGET lz4::lz4)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES lz4::lz4)
|
|
+ endif()
|
|
endif()
|
|
|
|
-find_package(Zstd MODULE)
|
|
-set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND})
|
|
-if(ZSTD_FOUND)
|
|
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
|
|
- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY})
|
|
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_Zstd)
|
|
+ find_package(zstd CONFIG)
|
|
+ if(TARGET zstd::libzstd_shared )
|
|
+ set(FOLLY_HAVE_LIBZSTD 1)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_shared)
|
|
+ elseif( TARGET zstd::libzstd_static )
|
|
+ set(FOLLY_HAVE_LIBZSTD 1)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_static)
|
|
+ endif()
|
|
endif()
|
|
|
|
-find_package(Snappy MODULE)
|
|
-set(FOLLY_HAVE_LIBSNAPPY ${SNAPPY_FOUND})
|
|
-if (SNAPPY_FOUND)
|
|
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR})
|
|
- list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY})
|
|
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_Snappy)
|
|
+ find_package(Snappy CONFIG)
|
|
+ if(TARGET Snappy::snappy)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES Snappy::snappy)
|
|
+ endif()
|
|
endif()
|
|
|
|
find_package(LibDwarf)
|
|
@@ -135,17 +139,24 @@ find_package(Libiberty)
|
|
list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES})
|
|
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS})
|
|
|
|
-find_package(LibAIO)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
|
|
+if(WITH_libaio)
|
|
+ find_package(LibAIO)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
|
|
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
|
|
+endif()
|
|
|
|
-find_package(LibUring)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
|
|
+if(WITH_liburing)
|
|
+ find_package(LibUring)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
|
|
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
|
|
+endif()
|
|
|
|
-find_package(Libsodium)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS})
|
|
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_unofficial-sodium)
|
|
+ find_package(unofficial-sodium CONFIG)
|
|
+ if(TARGET unofficial-sodium::sodium)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES unofficial-sodium::sodium)
|
|
+ endif()
|
|
+endif()
|
|
|
|
list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
|
|
@@ -156,10 +167,10 @@ if (PYTHON_EXTENSIONS)
|
|
endif ()
|
|
|
|
find_package(LibUnwind)
|
|
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
|
|
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
|
|
if (LIBUNWIND_FOUND)
|
|
set(FOLLY_HAVE_LIBUNWIND ON)
|
|
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
|
|
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
|
|
endif()
|
|
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
list(APPEND FOLLY_LINK_LIBRARIES "execinfo")
|
|
@@ -301,11 +312,7 @@ endif()
|
|
|
|
add_library(folly_deps INTERFACE)
|
|
|
|
-find_package(fmt CONFIG)
|
|
-if (NOT DEFINED fmt_CONFIG)
|
|
- # Fallback on a normal search on the current system
|
|
- find_package(Fmt MODULE REQUIRED)
|
|
-endif()
|
|
+find_package(fmt CONFIG REQUIRED)
|
|
target_link_libraries(folly_deps INTERFACE fmt::fmt)
|
|
|
|
list(REMOVE_DUPLICATES FOLLY_INCLUDE_DIRECTORIES)
|