mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 12:09:00 +08:00
[folly]: fix lib dependency (#25335)
* [folly]: fix lib dependency * [folly]: fix dependency * use file op delete cmake files * fix cmake config package * fix folly-config, minmax * delete fix-cmake-module.patch * revert LZ4 snappy * fix lz4 * fix libevent targert * fix bzip2 * remove sodium * add version * fix windows build * fix deps * fix deps * fix deps * fix deps * fix deps * fix deps * fix Required find_dependenct * fix feature
This commit is contained in:
parent
1704a11b5e
commit
a5e5f4de45
@ -1,13 +0,0 @@
|
||||
find_path(LZ4_INCLUDE_DIR lz4.h)
|
||||
|
||||
find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
|
||||
find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(LZ4)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
LZ4 DEFAULT_MSG
|
||||
LZ4_LIBRARY LZ4_INCLUDE_DIR
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
find_path(SNAPPY_INCLUDE_DIR snappy.h)
|
||||
|
||||
find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
|
||||
find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
select_library_configurations(SNAPPY)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
|
||||
SNAPPY DEFAULT_MSG
|
||||
SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR
|
||||
)
|
144
ports/folly/fix-deps.patch
Normal file
144
ports/folly/fix-deps.patch
Normal file
@ -0,0 +1,144 @@
|
||||
diff --git a/CMake/folly-config.cmake.in b/CMake/folly-config.cmake.in
|
||||
index 1689f9a..9adf390 100644
|
||||
--- a/CMake/folly-config.cmake.in
|
||||
+++ b/CMake/folly-config.cmake.in
|
||||
@@ -28,10 +28,18 @@ endif()
|
||||
set(FOLLY_LIBRARIES Folly::folly)
|
||||
|
||||
# Find folly's dependencies
|
||||
-find_dependency(fmt)
|
||||
+find_dependency(double-conversion CONFIG)
|
||||
+find_dependency(glog CONFIG)
|
||||
+find_dependency(gflags CONFIG)
|
||||
+find_dependency(Libevent CONFIG)
|
||||
+find_dependency(zstd CONFIG)
|
||||
+find_dependency(ZLIB MODULE)
|
||||
+find_dependency(OpenSSL MODULE)
|
||||
+find_dependency(unofficial-sodium CONFIG)
|
||||
+find_dependency(fmt CONFIG)
|
||||
|
||||
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 4b78e9f..f581b9a 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,30 +45,29 @@ find_package(Boost 1.51.0 MODULE
|
||||
thread
|
||||
REQUIRED
|
||||
)
|
||||
+set (Boost_LIBRARIES 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(double-conversion CONFIG REQUIRED)
|
||||
+list(APPEND FOLLY_LINK_LIBRARIES double-conversion::double-conversion)
|
||||
|
||||
-find_package(Glog CONFIG REQUIRED)
|
||||
-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND})
|
||||
+find_package(glog CONFIG REQUIRED)
|
||||
+set(FOLLY_HAVE_LIBGLOG 1)
|
||||
list(APPEND FOLLY_LINK_LIBRARIES glog::glog)
|
||||
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_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})
|
||||
+
|
||||
+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(LibEvent MODULE REQUIRED)
|
||||
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB})
|
||||
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
|
||||
+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()
|
||||
|
||||
find_package(ZLIB MODULE)
|
||||
set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
|
||||
@@ -111,11 +110,13 @@ if (LZ4_FOUND)
|
||||
list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY})
|
||||
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})
|
||||
+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()
|
||||
|
||||
find_package(Snappy MODULE)
|
||||
@@ -141,9 +142,10 @@ find_package(LibUring)
|
||||
list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
|
||||
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
|
||||
|
||||
-find_package(Libsodium)
|
||||
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES})
|
||||
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS})
|
||||
+find_package(unofficial-sodium CONFIG)
|
||||
+if(TARGET unofficial-sodium::sodium)
|
||||
+ list(APPEND FOLLY_LINK_LIBRARIES unofficial-sodium::sodium)
|
||||
+endif()
|
||||
|
||||
list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
|
||||
@@ -154,9 +156,9 @@ 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)
|
||||
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
|
||||
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
|
||||
set(FOLLY_HAVE_LIBUNWIND ON)
|
||||
endif()
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||
@@ -299,11 +301,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)
|
@ -16,14 +16,19 @@ vcpkg_from_github(
|
||||
disable-non-underscore-posix-names.patch
|
||||
boost-1.70.patch
|
||||
fix-windows-minmax.patch
|
||||
fix-deps.patch
|
||||
)
|
||||
|
||||
file(COPY
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FindLZ4.cmake"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/FindSnappy.cmake"
|
||||
DESTINATION "${SOURCE_PATH}/CMake/"
|
||||
)
|
||||
file(REMOVE "${SOURCE_PATH}/CMake/FindGFlags.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/CMake/FindFmt.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/CMake/FindLibsodium.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/CMake/FindZstd.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindDoubleConversion.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGMock.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGflags.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindGlog.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindLibEvent.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindSodium.cmake")
|
||||
file(REMOVE "${SOURCE_PATH}/build/fbcode_builder/CMake/FindZstd.cmake")
|
||||
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
set(MSVC_USE_STATIC_RUNTIME ON)
|
||||
@ -47,6 +52,7 @@ feature(lzma LibLZMA)
|
||||
feature(lz4 LZ4)
|
||||
feature(zstd Zstd)
|
||||
feature(snappy Snappy)
|
||||
feature(libsodium unofficial-sodium)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
@ -77,14 +83,6 @@ STRING(REPLACE "\${VCPKG_IMPORT_PREFIX}/lib/" "\${VCPKG_IMPORT_PREFIX}/\$<\$<CON
|
||||
STRING(REPLACE "\${VCPKG_IMPORT_PREFIX}/debug/lib/" "\${VCPKG_IMPORT_PREFIX}/\$<\$<CONFIG:DEBUG>:debug/>lib/" _contents "${_contents}")
|
||||
string(REPLACE "-vc140-mt.lib" "-vc140-mt\$<\$<CONFIG:DEBUG>:-gd>.lib" _contents "${_contents}")
|
||||
FILE(WRITE ${FOLLY_TARGETS_CMAKE} "${_contents}")
|
||||
FILE(READ "${CURRENT_PACKAGES_DIR}/share/folly/folly-config.cmake" _contents)
|
||||
FILE(WRITE "${CURRENT_PACKAGES_DIR}/share/folly/folly-config.cmake"
|
||||
"include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
find_dependency(glog CONFIG)
|
||||
find_dependency(gflags CONFIG REQUIRED)
|
||||
find_dependency(ZLIB)
|
||||
${_contents}")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "folly",
|
||||
"version-string": "2022.08.15.00",
|
||||
"port-version": 1,
|
||||
"description": "An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows",
|
||||
"homepage": "https://github.com/facebook/folly",
|
||||
"license": "Apache-2.0",
|
||||
@ -43,6 +44,12 @@
|
||||
"bzip2"
|
||||
]
|
||||
},
|
||||
"libsodium": {
|
||||
"description": "Support libsodium for cryto",
|
||||
"dependencies": [
|
||||
"libsodium"
|
||||
]
|
||||
},
|
||||
"lz4": {
|
||||
"description": "Support lz4 for compression",
|
||||
"dependencies": [
|
||||
|
@ -2374,7 +2374,7 @@
|
||||
},
|
||||
"folly": {
|
||||
"baseline": "2022.08.15.00",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"font-chef": {
|
||||
"baseline": "1.1.0",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "968cb6f9f5300306d010ffabc297339c40ade808",
|
||||
"version-string": "2022.08.15.00",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "f046523ca3488aa4e35d11656fcb15acb5b0f4f3",
|
||||
"version-string": "2022.08.15.00",
|
||||
|
Loading…
Reference in New Issue
Block a user