-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On '1.7.x-vcpkg' branch: Merge all changes in build/vcpkg and
.github/workflows/windows-vcpkg.yml from trunk. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x-vcpkg@1917332 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Ivan Zhakov
committed
Apr 25, 2024
1 parent
5527e87
commit b36f005
Showing
3 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Vcpkg (Windows) | ||
|
||
on: | ||
push: | ||
branches: [ "trunk" ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
triplet: | ||
- x64-windows | ||
- x64-windows-static | ||
- x64-windows-static-md | ||
- x86-windows | ||
- x86-windows-static | ||
port: | ||
- apr-2 | ||
- apr-2[core] | ||
- apr-2[crypto,dbd-sqlite3,dbd-odbc,private-headers,xlate] | ||
fail-fast: false | ||
|
||
name: "${{ matrix.port }}:${{ matrix.triplet }} on ${{ matrix.os }}" | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
|
||
steps: | ||
- name: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Vcpkg Install | ||
run: C:\vcpkg\vcpkg.exe install ${{ matrix.port }} --head --overlay-ports ${{ github.workspace }}\build\vcpkg --triplet ${{ matrix.triplet }} --enforce-port-checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
set(VERSION 2.0.0) | ||
# | ||
# Modify REF to latest commit id from https://github.com/apache/apr | ||
# Update SHA512 with actual SHA512 | ||
# | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO apache/apr | ||
REF 6445e8804008922f8018aa238aa4d6bba608c49a | ||
SHA512 0 | ||
HEAD_REF trunk | ||
) | ||
|
||
if (VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
private-headers INSTALL_PRIVATE_H | ||
crypto FEATURE_CRYPTO | ||
xlate FEATURE_XLATE | ||
dbd-sqlite3 FEATURE_DBD_SQLITE3 | ||
) | ||
|
||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" APR_BUILD_STATIC) | ||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" APR_BUILD_SHARED) | ||
|
||
if (FEATURE_MINIMAL_BUILD) | ||
set(APU_USE_EXPAT OFF) | ||
else() | ||
set(APU_USE_EXPAT ON) | ||
endif() | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DAPR_BUILD_STATIC=${APR_BUILD_STATIC} | ||
-DAPR_BUILD_SHARED=${APR_BUILD_SHARED} | ||
-DAPR_MODULAR_DSO=${APR_BUILD_SHARED} | ||
-DAPR_BUILD_TESTAPR=OFF | ||
-DINSTALL_PDB=OFF | ||
-DAPU_HAVE_CRYPTO=${FEATURE_CRYPTO} | ||
-DAPU_HAVE_ICONV=${FEATURE_XLATE} | ||
-DAPU_HAVE_SQLITE3=${FEATURE_DBD_SQLITE3} | ||
-DAPU_USE_EXPAT=${APU_USE_EXPAT} | ||
-DAPR_INSTALL_PRIVATE_H=${INSTALL_PRIVATE_H} | ||
) | ||
|
||
vcpkg_cmake_install() | ||
vcpkg_copy_pdbs() | ||
vcpkg_cmake_config_fixup(PACKAGE_NAME "apr" | ||
CONFIG_PATH "lib/cmake/apr") | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
else() | ||
# In development | ||
endif() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
# Handle copyright | ||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"name": "apr-2", | ||
"version": "2.0.0", | ||
"port-version": 5, | ||
"description": "The Apache Portable Runtime (APR) is a C library that forms a system portability layer that covers many operating systems.", | ||
"homepage": "https://apr.apache.org/", | ||
"supports": "!uwp", | ||
"dependencies": [ | ||
"expat", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true, | ||
"platform": "windows" | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"crypto": { | ||
"description": "Crypto support", | ||
"dependencies": [ | ||
{ | ||
"name": "openssl", | ||
"default-features": false, | ||
"features": [] | ||
} | ||
] | ||
}, | ||
"dbd-sqlite3": { | ||
"description": "Build SQLite3 DBD driver", | ||
"dependencies": [ | ||
"sqlite3" | ||
] | ||
}, | ||
"dbd-odbc": { | ||
"description": "Build ODBC DBD driver" | ||
}, | ||
"private-headers": { | ||
"description": "Install non-standard files required for building Apache httpd" | ||
}, | ||
"xlate": { | ||
"description": "Xlate support", | ||
"dependencies": [ | ||
"libiconv" | ||
] | ||
} | ||
}, | ||
"default-features": [] | ||
} |