Skip to content

Commit d121b49

Browse files
[apr] Add HOST_TOOLS_DIR/gen_test_char for cross-compiling to Windows (#41416)
1 parent e63bd09 commit d121b49

8 files changed

Lines changed: 57 additions & 11 deletions

File tree

ports/activemq-cpp/vcpkg.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "activemq-cpp",
33
"version-semver": "3.9.5",
4-
"port-version": 16,
4+
"port-version": 17,
55
"description": "Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server.",
66
"license": "Apache-2.0",
7-
"supports": "!(uwp | osx)",
7+
"supports": "(windows & !uwp & (x86 | x64)) | (!windows & !osx)",
88
"dependencies": [
99
"apr",
1010
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index d16eec6..92146f4 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -87,13 +87,17 @@ STRING(REGEX REPLACE ".*#define APR_PATCH_VERSION[ \t]+([0-9]+).*" "\\1" APR_PAT
6+
7+
CONFIGURE_FILE(include/apr.hwc
8+
${PROJECT_BINARY_DIR}/apr.h)
9+
10+
ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c)
11+
12+
+set(UNOFFICIAL_APR_HOST_TOOLS_DIR "$<TARGET_FILE_DIR:gen_test_char>" CACHE STRING "")
13+
+set(UNOFFICIAL_APR_HOST_EXECUTABLE_SUFFIX "$<TARGET_PROPERTY:gen_test_char,SUFFIX>" CACHE STRING "")
14+
+install(TARGETS gen_test_char)
15+
+
16+
ADD_CUSTOM_COMMAND(
17+
COMMENT "Generating character tables, apr_escape_test_char.h, for current locale"
18+
DEPENDS gen_test_char
19+
- COMMAND $<TARGET_FILE:gen_test_char> > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
20+
+ COMMAND "${UNOFFICIAL_APR_HOST_TOOLS_DIR}/gen_test_char${UNOFFICIAL_APR_HOST_EXECUTABLE_SUFFIX}" > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
21+
OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
22+
)
23+
ADD_CUSTOM_TARGET(

ports/apr/portfile.cmake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
set(VERSION 1.7.5)
3-
41
vcpkg_download_distfile(ARCHIVE
52
URLS "https://archive.apache.org/dist/apr/apr-${VERSION}.tar.bz2"
63
FILENAME "apr-${VERSION}.tar.bz2"
@@ -11,8 +8,19 @@ vcpkg_extract_source_archive(SOURCE_PATH
118
ARCHIVE "${ARCHIVE}"
129
PATCHES
1310
unglue.patch
11+
0100-add-host-tools-dir.diff
1412
)
1513

14+
set(CURRENT_HOST_TOOLS_DIR "${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}")
15+
16+
set(CROSSCOMPILING_OPTIONS "")
17+
if(VCPKG_CROSSCOMPILING)
18+
list(APPEND CROSSCOMPILING_OPTIONS
19+
"-DUNOFFICIAL_APR_HOST_TOOLS_DIR=${CURRENT_HOST_TOOLS_DIR}"
20+
"-DUNOFFICIAL_APR_HOST_EXECUTABLE_SUFFIX=${VCPKG_HOST_EXECUTABLE_SUFFIX}"
21+
)
22+
endif()
23+
1624
if (VCPKG_TARGET_IS_WINDOWS)
1725
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
1826
FEATURES
@@ -32,6 +40,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
3240
-DMIN_WINDOWS_VER=Windows7
3341
-DAPR_HAVE_IPV6=ON
3442
${FEATURE_OPTIONS}
43+
${CROSSCOMPILING_OPTIONS}
3544
)
3645

3746
vcpkg_cmake_install()
@@ -42,6 +51,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
4251
)
4352
# There is no way to suppress installation of the headers in debug builds.
4453
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
54+
vcpkg_copy_tools(TOOL_NAMES gen_test_char AUTO_CLEAN)
4555

4656
vcpkg_copy_pdbs()
4757

ports/apr/vcpkg.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
{
22
"name": "apr",
33
"version": "1.7.5",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.",
66
"homepage": "https://apr.apache.org/",
77
"license": "Apache-2.0",
8-
"supports": "!uwp",
8+
"supports": "!uwp & !mingw",
99
"dependencies": [
10+
{
11+
"name": "apr",
12+
"host": true,
13+
"platform": "windows"
14+
},
1015
{
1116
"name": "vcpkg-cmake",
1217
"host": true,

scripts/ci.baseline.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ allegro5:x64-android=fail
5151
apr:arm-neon-android=fail
5252
apr:arm64-android=fail
5353
apr:x64-android=fail
54-
# Cross compiling CI machine cannot run gen_test_char to generate apr_escape_test_char.h
55-
apr:arm64-windows=fail
5654
apsi:arm-neon-android=fail
5755
apsi:x64-android=fail
5856
# Broken with CUDA 12; needs update to 3.8.3 and https://github.com/arrayfire/arrayfire/issues/3349 fixed

versions/a-/activemq-cpp.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "0066f657df214848cbfd6b991e8ff4a52902e81b",
5+
"version-semver": "3.9.5",
6+
"port-version": 17
7+
},
38
{
49
"git-tree": "1644c99e45b2364ea36c0307b4d7171f4717ccdc",
510
"version-semver": "3.9.5",

versions/a-/apr.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "dfa11d3e5058b640b37c1a6845dbc2980496a7c8",
5+
"version": "1.7.5",
6+
"port-version": 2
7+
},
38
{
49
"git-tree": "499cf5fc0959f4a049ec72f0f556400e7191ffd3",
510
"version": "1.7.5",

versions/baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"activemq-cpp": {
3636
"baseline": "3.9.5",
37-
"port-version": 16
37+
"port-version": 17
3838
},
3939
"ada-url": {
4040
"baseline": "2.9.2",
@@ -170,7 +170,7 @@
170170
},
171171
"apr": {
172172
"baseline": "1.7.5",
173-
"port-version": 1
173+
"port-version": 2
174174
},
175175
"apr-util": {
176176
"baseline": "1.6.3",

0 commit comments

Comments
 (0)