Skip to content

Commit 3285071

Browse files
committed
Fix Android build by downgrading ada-url.
See CesiumGS/cesium-unreal#1679.
1 parent 29c6673 commit 3285071

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index b206edb6..1db4099d 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -30,7 +30,6 @@ option(ADA_TESTING "Build tests" ${BUILD_TESTING})
6+
# errors due to CPM, so this is here to support disabling all the testing
7+
# and tooling for ada if one only wishes to use the ada library.
8+
if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)
9+
- include(cmake/CPM.cmake)
10+
# CPM requires git as an implicit dependency
11+
find_package(Git QUIET)
12+
# We use googletest in the tests
13+
diff --git a/tools/cli/CMakeLists.txt b/tools/cli/CMakeLists.txt
14+
index ff57220b..a6d90f29 100644
15+
--- a/tools/cli/CMakeLists.txt
16+
+++ b/tools/cli/CMakeLists.txt
17+
@@ -8,12 +8,8 @@ if(MSVC AND BUILD_SHARED_LIBS)
18+
"$<TARGET_FILE:ada>" # <--this is in-file
19+
"$<TARGET_FILE_DIR:adaparse>") # <--this is out-file path
20+
endif()
21+
-CPMAddPackage("gh:fmtlib/fmt#10.2.1")
22+
-CPMAddPackage(
23+
- GITHUB_REPOSITORY jarro2783/cxxopts
24+
- VERSION 3.2.0
25+
- OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
26+
-)
27+
+find_package(fmt CONFIG REQUIRED)
28+
+find_package(cxxopts CONFIG REQUIRED)
29+
target_link_libraries(adaparse PRIVATE cxxopts::cxxopts fmt::fmt)
30+
31+
if(MSVC OR MINGW)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO ada-url/ada
4+
REF "v${VERSION}"
5+
SHA512 bc876db537153d6b0599215ca8be8261bceca6d213fcc63af5fda13c1b32876496cb8d4e98c787f17317cf8ffd1940431551513807f1a18f9ce993fad35f5ec6
6+
HEAD_REF main
7+
PATCHES
8+
no-cpm.patch
9+
)
10+
11+
vcpkg_check_features(
12+
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
13+
FEATURES
14+
tools ADA_TOOLS
15+
)
16+
17+
vcpkg_cmake_configure(
18+
SOURCE_PATH "${SOURCE_PATH}"
19+
OPTIONS
20+
-DADA_BENCHMARKS=OFF
21+
-DBUILD_TESTING=OFF
22+
-DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON
23+
${FEATURE_OPTIONS}
24+
OPTIONS_DEBUG
25+
-DADA_TOOLS=OFF
26+
)
27+
28+
vcpkg_cmake_install()
29+
30+
vcpkg_copy_pdbs()
31+
32+
vcpkg_cmake_config_fixup(PACKAGE_NAME ada CONFIG_PATH "lib/cmake/ada")
33+
34+
if("tools" IN_LIST FEATURES)
35+
vcpkg_copy_tools(TOOL_NAMES adaparse AUTO_CLEAN)
36+
endif()
37+
38+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
39+
40+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE-APACHE" "${SOURCE_PATH}/LICENSE-MIT")
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "ada-url",
3+
"version": "2.9.2",
4+
"description": "WHATWG-compliant and fast URL parser written in modern C++",
5+
"homepage": "https://ada-url.com/",
6+
"license": "MIT",
7+
"dependencies": [
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
},
12+
{
13+
"name": "vcpkg-cmake-config",
14+
"host": true
15+
}
16+
],
17+
"features": {
18+
"tools": {
19+
"description": "Build CLI tools (adaparse)",
20+
"supports": "!uwp",
21+
"dependencies": [
22+
"cxxopts",
23+
"fmt"
24+
]
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)