mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 03:10:57 +08:00
[drogon] Update to 1.7.3 (#21122)
* Update drogon to 1.7.3 * Update CI baseline * Fix vcpkg_check_linkage * Update git-tree hash * Add patch to fix ARM64 builds * Update git-tree hash * Set ADD_BIN_TO_PATH * Update git-tree hash Co-authored-by: chausner <chausner@users.noreply.github.com>
This commit is contained in:
parent
3a7dd9f9ec
commit
014a40ac64
@ -0,0 +1,58 @@
|
||||
From e2eb67478157bbdf5ff91ca5dea2f9435af4488f Mon Sep 17 00:00:00 2001
|
||||
From: Martin Chang <marty1885@users.noreply.github.com>
|
||||
Date: Thu, 21 Oct 2021 19:43:53 +0800
|
||||
Subject: [PATCH] Fix Drogon not building caused by FindFilesystem (#1056)
|
||||
|
||||
* fix FindFilesystem not using the correct header for printf
|
||||
|
||||
* fix FS not found on Yocto
|
||||
---
|
||||
CMakeLists.txt | 6 +++++-
|
||||
cmake_modules/FindFilesystem.cmake | 7 ++++++-
|
||||
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0b2b8d4..3f929a4 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -191,7 +191,11 @@ if(NEED_BOOST_FS)
|
||||
option(HAS_STD_FILESYSTEM_PATH "use boost::filesystem" OFF)
|
||||
else()
|
||||
option(HAS_STD_FILESYSTEM_PATH "use std::filesystem" ON)
|
||||
- target_link_libraries(${PROJECT_NAME} PUBLIC std::filesystem)
|
||||
+ # HACK: Needed to be compiled on Yocto Linux
|
||||
+ get_property(CAN_LINK_FS TARGET std::filesystem PROPERTY INTERFACE_LINK_LIBRARIES DEFINED)
|
||||
+ if ( CAN_LINK_FS )
|
||||
+ target_link_libraries(${PROJECT_NAME} PUBLIC std::filesystem)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
# jsoncpp
|
||||
diff --git a/cmake_modules/FindFilesystem.cmake b/cmake_modules/FindFilesystem.cmake
|
||||
index c8d9a57..73dd763 100644
|
||||
--- a/cmake_modules/FindFilesystem.cmake
|
||||
+++ b/cmake_modules/FindFilesystem.cmake
|
||||
@@ -194,7 +194,7 @@ set(_found FALSE)
|
||||
if(CXX_FILESYSTEM_HAVE_FS)
|
||||
# We have some filesystem library available. Do link checks
|
||||
string(CONFIGURE [[
|
||||
- #include <cstdlib>
|
||||
+ #include <cstdio>
|
||||
#include <@CXX_FILESYSTEM_HEADER@>
|
||||
|
||||
int main() {
|
||||
@@ -204,6 +204,11 @@ if(CXX_FILESYSTEM_HAVE_FS)
|
||||
}
|
||||
]] code @ONLY)
|
||||
|
||||
+ # HACK: Needed to compile correctly on Yocto Linux
|
||||
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GCC" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
|
||||
+ OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
||||
+ set(CMAKE_REQUIRED_FLAGS ${prev_req_flags} -std=c++17)
|
||||
+ endif ()
|
||||
# Check a simple filesystem program without any linker flags
|
||||
_cmcm_check_cxx_source("${code}" CXX_FILESYSTEM_NO_LINK_NEEDED)
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
@ -1,14 +1,14 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO an-tao/drogon
|
||||
REF v1.7.1
|
||||
SHA512 8a7cb8aa87cc48b130a5b47558b3c9e2a0af13cd8b76681e42d14a366dac75c88e389f2e2fe03b4f0f1e0e31971a47eee2bf5df8fcb4b79f8ed00d2a592315b6
|
||||
REF v1.7.3
|
||||
SHA512 20146bf59898704f3b44778fa46e919d9124ef8a33eb1cfcce7f437507c20920829a0074e1c9e2493a1764b8a36b1a91b03f117fd78e740253b15d2146dca628
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
vcpkg.patch
|
||||
resolv.patch
|
||||
drogon_config.patch
|
||||
static-brotli.patch
|
||||
Fix-Drogon-not-building-caused-by-FindFilesystem-105.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(
|
||||
@ -23,38 +23,41 @@ vcpkg_check_features(
|
||||
sqlite3 BUILD_SQLITE
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DROGON_SHARED)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
DISABLE_PARALLEL_CONFIGURE
|
||||
OPTIONS
|
||||
-DBUILD_DROGON_SHARED=${BUILD_DROGON_SHARED}
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
|
||||
${FEATURE_OPTIONS}
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_DISABLE_FIND_PACKAGE_Boost
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_cmake_install(ADD_BIN_TO_PATH)
|
||||
|
||||
# Fix CMake files
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Drogon)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Drogon)
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Copy drogon_ctl
|
||||
if("ctl" IN_LIST FEATURES)
|
||||
message("copying tools")
|
||||
vcpkg_copy_tools(TOOL_NAMES drogon_ctl
|
||||
AUTO_CLEAN)
|
||||
vcpkg_copy_tools(TOOL_NAMES drogon_ctl AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
# # Remove includes in debug
|
||||
# Remove includes in debug
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
# Copy pdb files
|
||||
vcpkg_copy_pdbs()
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
|
||||
--- a/drogon_ctl/CMakeLists.txt
|
||||
+++ b/drogon_ctl/CMakeLists.txt
|
||||
@@ -39,6 +39,9 @@
|
||||
if(WIN32)
|
||||
target_link_libraries(drogon_ctl PRIVATE ws2_32 Rpcrt4)
|
||||
endif(WIN32)
|
||||
+if(APPLE)
|
||||
+ target_link_libraries(drogon_ctl PRIVATE resolv)
|
||||
+endif()
|
||||
message(STATUS "bin:" ${INSTALL_BIN_DIR})
|
||||
install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
|
||||
if(WIN32)
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "drogon",
|
||||
"version-semver": "1.7.1",
|
||||
"port-version": 2,
|
||||
"version-semver": "1.7.3",
|
||||
"description": "A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows",
|
||||
"homepage": "https://github.com/an-tao/drogon",
|
||||
"documentation": "https://drogon.docsforge.com/master/overview/",
|
||||
@ -14,6 +13,14 @@
|
||||
"platform": "!windows"
|
||||
},
|
||||
"trantor",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
],
|
||||
"features": {
|
||||
@ -43,7 +50,7 @@
|
||||
]
|
||||
},
|
||||
"orm": {
|
||||
"description": "Build with Object-relational mapping support."
|
||||
"description": "Build with object-relational mapping support."
|
||||
},
|
||||
"postgres": {
|
||||
"description": "Support reading and writing from/to Postgres databases.",
|
||||
@ -69,7 +76,7 @@
|
||||
]
|
||||
},
|
||||
"sqlite3": {
|
||||
"description": "Support reading and writing from/to Sqlite databases.",
|
||||
"description": "Support reading and writing from/to SQLite databases.",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "drogon",
|
||||
|
@ -1,8 +1,7 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 7465e46..9650a59 100755
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -99,9 +99,9 @@ if (WIN32)
|
||||
@@ -120,9 +120,9 @@ if (WIN32)
|
||||
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
|
||||
endif (WIN32)
|
||||
|
||||
@ -12,9 +11,9 @@ index 7465e46..9650a59 100755
|
||||
-target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
|
||||
+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor)
|
||||
|
||||
if (NOT WIN32)
|
||||
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
@@ -205,11 +205,10 @@ endif (NOT WIN32)
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku")
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE network)
|
||||
@@ -316,11 +316,10 @@ endif (NOT WIN32)
|
||||
|
||||
if (BUILD_POSTGRESQL)
|
||||
# find postgres
|
||||
@ -27,15 +26,27 @@ index 7465e46..9650a59 100755
|
||||
+ if(PostgreSQL_FOUND)
|
||||
+ set(pg_FOUND true)
|
||||
+ target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL)
|
||||
set(DROGON_SOURCES ${DROGON_SOURCES}
|
||||
set(DROGON_SOURCES
|
||||
${DROGON_SOURCES}
|
||||
orm_lib/src/postgresql_impl/PostgreSQLResultImpl.cc)
|
||||
if (LIBPQ_BATCH_MODE)
|
||||
@@ -228,7 +227,7 @@ if (BUILD_POSTGRESQL)
|
||||
set(DROGON_SOURCES ${DROGON_SOURCES}
|
||||
orm_lib/src/postgresql_impl/PgConnection.cc)
|
||||
@@ -348,7 +348,7 @@ if (BUILD_POSTGRESQL)
|
||||
${private_headers}
|
||||
orm_lib/src/postgresql_impl/PgConnection.h)
|
||||
endif (libpq_supports_batch)
|
||||
- endif (pg_FOUND)
|
||||
+ endif (PostgreSQL_FOUND)
|
||||
endif (BUILD_POSTGRESQL)
|
||||
|
||||
if (BUILD_MYSQL)
|
||||
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
|
||||
--- a/drogon_ctl/CMakeLists.txt
|
||||
+++ b/drogon_ctl/CMakeLists.txt
|
||||
@@ -19,7 +19,7 @@ add_executable(_drogon_ctl
|
||||
target_link_libraries(_drogon_ctl ${PROJECT_NAME})
|
||||
if (WIN32 AND BUILD_DROGON_SHARED)
|
||||
set(DROGON_FILE $<TARGET_FILE:drogon>)
|
||||
- set(TRANTOR_FILE $<TARGET_FILE:trantor>)
|
||||
+ set(TRANTOR_FILE $<TARGET_FILE:Trantor::Trantor>)
|
||||
add_custom_command(TARGET _drogon_ctl POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCTL_FILE=${DROGON_FILE}
|
||||
|
@ -1897,8 +1897,8 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"drogon": {
|
||||
"baseline": "1.7.1",
|
||||
"port-version": 2
|
||||
"baseline": "1.7.3",
|
||||
"port-version": 0
|
||||
},
|
||||
"dtl": {
|
||||
"baseline": "1.19",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "35877feed401993a073b537fbd89f8b55b5be6d1",
|
||||
"version-semver": "1.7.3",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "34e8225c88ebbf0713112235dddbe6eae11121fb",
|
||||
"version-semver": "1.7.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user