[drogon] fix cross compilation (#33713)

This commit is contained in:
autoantwort 2023-10-10 00:07:33 +02:00 committed by GitHub
parent 0e85eeb82a
commit 9e968a3212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 3 deletions

View File

@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88026025..d6f180fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ option(BUILD_DOC "Build Doxygen documentation" OFF)
option(BUILD_BROTLI "Build Brotli" ON)
option(BUILD_YAML_CONFIG "Build yaml config" ON)
option(USE_SUBMODULE "Use trantor as a submodule" ON)
+set(DROGON_CTL_TOOL "" CACHE STRING "drogon_ctl tool executable when doing cross builds")
include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(BUILD_POSTGRESQL "Build with postgresql support" ON "BUILD_ORM" OFF)
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
index 249c453d..16b346ea 100755
--- a/drogon_ctl/CMakeLists.txt
+++ b/drogon_ctl/CMakeLists.txt
@@ -43,7 +43,7 @@ foreach(cspFile ${SCP_LIST})
get_filename_component(classname ${cspFile} NAME_WE)
message(STATUS "view classname:" ${classname})
add_custom_command(OUTPUT ${classname}.h ${classname}.cc
- COMMAND $<TARGET_FILE:_drogon_ctl>
+ COMMAND $<IF:$<BOOL:${DROGON_CTL_TOOL}>,${DROGON_CTL_TOOL},$<TARGET_FILE:_drogon_ctl>>
ARGS
create
view

View File

@ -9,8 +9,14 @@ vcpkg_from_github(
0002-drogon-config.patch
0003-deps-redis.patch
0004-drogon-ctl.patch
0005-drogon-cross-compile.patch
)
set(DROGON_CTL_TOOL "")
if(VCPKG_CROSSCOMPILING)
set(DROGON_CTL_TOOL "${CURRENT_HOST_INSTALLED_DIR}/tools/drogon/drogon_ctl${VCPKG_HOST_EXECUTABLE_SUFFIX}")
endif()
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
@ -33,7 +39,8 @@ vcpkg_cmake_configure(
-DBUILD_EXAMPLES=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
-DUSE_SUBMODULE=OFF
${FEATURE_OPTIONS}
"-DDROGON_CTL_TOOL=${DROGON_CTL_TOOL}"
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_Boost
)

View File

@ -1,6 +1,7 @@
{
"name": "drogon",
"version": "1.8.7",
"port-version": 1,
"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/",
@ -26,7 +27,17 @@
],
"features": {
"ctl": {
"description": "Build drogon_ctl tool."
"description": "Build drogon_ctl tool.",
"dependencies": [
{
"name": "drogon",
"host": true,
"default-features": false,
"features": [
"ctl"
]
}
]
},
"mysql": {
"description": "Support reading and writing from/to MySQL databases.",

View File

@ -2230,7 +2230,7 @@
},
"drogon": {
"baseline": "1.8.7",
"port-version": 0
"port-version": 1
},
"dstorage": {
"baseline": "1.2.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3dc8fd6d40ad624513353e295fbd39a0dd237c91",
"version": "1.8.7",
"port-version": 1
},
{
"git-tree": "01b8dcf586886018269bc888cc651751d074d4c6",
"version": "1.8.7",