Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wangle]:fix dependency #30792

Merged
merged 10 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/folly/fix-deps.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ index 4b78e9f..ac83c99 100644
thread
REQUIRED
)
+set (Boost_LIBRARIES Boost::context Boost::filesystem Boost::program_options Boost::regex Boost::system Boost::thread
+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})
Expand Down
2 changes: 1 addition & 1 deletion ports/folly/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "folly",
"version-string": "2022.10.31.00",
"port-version": 5,
"port-version": 6,
"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",
Expand Down
89 changes: 56 additions & 33 deletions ports/wangle/fix_dependency.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
diff --git a/wangle/CMakeLists.txt b/wangle/CMakeLists.txt
index 8df7c76..f605f25 100644
index 977bbe4..155f9cc 100644
--- a/wangle/CMakeLists.txt
+++ b/wangle/CMakeLists.txt
@@ -62,7 +62,7 @@ find_package(folly CONFIG REQUIRED)
@@ -64,18 +64,23 @@ set(CMAKE_INSTALL_DIR lib/cmake/wangle CACHE STRING
find_package(folly CONFIG REQUIRED)

find_package(fizz CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
-find_package(fmt CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
-find_package(Glog REQUIRED)
-find_package(gflags CONFIG QUIET)
+find_package(glog CONFIG REQUIRED)
find_package(gflags CONFIG QUIET)
+find_package(gflags CONFIG REQUIRED)
+find_package(Boost REQUIRED
+ COMPONENTS
+ filesystem
+ thread
+)
+
if (gflags_FOUND)
message(STATUS "Found gflags from package config")
@@ -70,8 +70,8 @@ if (gflags_FOUND)
message(STATUS "gflags_CONFIG=${gflags_CONFIG}")
else()
find_package(Gflags REQUIRED)
endif()
Expand All @@ -22,35 +31,49 @@ index 8df7c76..f605f25 100644
find_package(Threads REQUIRED)
if (UNIX AND NOT APPLE)
find_package(Librt)
@@ -153,24 +153,23 @@ target_include_directories(
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
+ PRIVATE
${FIZZ_INCLUDE_DIR}
${FOLLY_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${GLOG_INCLUDE_DIRS}
${GFLAGS_INCLUDE_DIRS}
- ${LIBEVENT_INCLUDE_DIR}
- ${DOUBLE_CONVERSION_INCLUDE_DIRS}
@@ -166,6 +171,14 @@ target_include_directories(
${LIBEVENT_INCLUDE_DIR}
${DOUBLE_CONVERSION_INCLUDE_DIRS}
)
+set(Boost_LIBRARIES Boost::boost Boost::filesystem Boost::thread )
+set(FOLLY_LIBRARIES Folly::folly)
+set(FIZZ_LIBRARIES fizz::fizz)
+set(GLOG_LIBRARIES glog::glog)
+set(GFLAGS_LIBRARIES gflags::gflags)
+set(LIBEVENT_LIB libevent::core libevent::extra)
+set(DOUBLE_CONVERSION_LIBRARIES double-conversion::double-conversion)
+
target_link_libraries(wangle PUBLIC
${FOLLY_LIBRARIES}
${FIZZ_LIBRARIES}
${Boost_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${GLOG_LIBRARIES}
+ OpenSSL::SSL
+ OpenSSL::Crypto
+ glog::glog
${GFLAGS_LIBRARIES}
- ${LIBEVENT_LIB}
- ${DOUBLE_CONVERSION_LIBRARIES}
+ libevent::core
+ libevent::extra
+ double-conversion::double-conversion
${CMAKE_DL_LIBS}
${LIBRT_LIBRARIES}
Threads::Threads)
diff --git a/wangle/cmake/wangle-config.cmake.in b/wangle/cmake/wangle-config.cmake.in
index e0fd0dc..5f6cf14 100644
--- a/wangle/cmake/wangle-config.cmake.in
+++ b/wangle/cmake/wangle-config.cmake.in
@@ -15,13 +15,19 @@ set_and_check(WANGLE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(WANGLE_CMAKE_DIR "${PACKAGE_PREFIX_DIR}/share/wangle")

include(CMakeFindDependencyMacro)
-find_dependency(folly REQUIRED)
-find_dependency(fizz REQUIRED)
-find_dependency(glog REQUIRED)
-find_dependency(Threads REQUIRED)
-find_dependency(Libevent REQUIRED)
-find_dependency(OpenSSL REQUIRED)
-find_dependency(double-conversion REQUIRED)
+find_dependency(folly CONFIG)
+find_dependency(fizz CONFIG)
+find_dependency(gflags CONFIG)
+find_dependency(glog CONFIG)
+find_dependency(Threads)
+find_dependency(Libevent CONFIG)
+find_dependency(OpenSSL)
+find_dependency(double-conversion CONFIG)
+find_dependency(Boost
+ COMPONENTS
+ filesystem
+ thread
+)

if (NOT TARGET wangle::wangle)
include("${WANGLE_CMAKE_DIR}/wangle-targets.cmake")
11 changes: 11 additions & 0 deletions ports/wangle/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ vcpkg_from_github(
fix_dependency.patch
)

file(REMOVE
"${SOURCE_PATH}/wangle/cmake/FindDoubleConversion.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindGflags.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindGlog.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindGMock.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindLibEvent.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindSodium.cmake"
"${SOURCE_PATH}/build/fbcode_builder/CMake/FindZstd.cmake"
)


Copy link
Contributor

@Adela0814 Adela0814 Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that would be nice to remove but I don't want to force the PR build to be out of date over a style change like that. Something to fix next time we touch it. Thanks for pointing it out though!

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/wangle"
OPTIONS
Expand Down
2 changes: 2 additions & 0 deletions ports/wangle/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "wangle",
"version-string": "2022.03.21.00",
"port-version": 1,
"description": "Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.",
"homepage": "https://github.com/facebook/wangle",
"license": "Apache-2.0",
Expand All @@ -13,6 +14,7 @@
"double-conversion",
"fizz",
"folly",
"gflags",
"glog",
"libevent",
"openssl",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@
},
"folly": {
"baseline": "2022.10.31.00",
"port-version": 5
"port-version": 6
},
"font-chef": {
"baseline": "1.1.0",
Expand Down Expand Up @@ -8382,7 +8382,7 @@
},
"wangle": {
"baseline": "2022.03.21.00",
"port-version": 0
"port-version": 1
},
"wasmedge": {
"baseline": "0.12.0-alpha.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/folly.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "204d88dbc53dc5ff37c58459c1af0c6f19f446db",
"version-string": "2022.10.31.00",
"port-version": 6
},
{
"git-tree": "2be8536b3faaf9f907284548e4db1f49b77054c1",
"version-string": "2022.10.31.00",
Expand Down
5 changes: 5 additions & 0 deletions versions/w-/wangle.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e79739dcf42e3dd4d0e32c595b27ece48c762bdd",
"version-string": "2022.03.21.00",
"port-version": 1
},
{
"git-tree": "6f0fec69eddf934964ee77b9923f68da2c3c7724",
"version-string": "2022.03.21.00",
Expand Down