Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ if (NOT VCPKG_OVERLAY_PORTS)
endif()
endif()

list(APPEND VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/extern/vcpkg/ports")

message(STATUS "VCPKG_OVERLAY_PORTS ${VCPKG_OVERLAY_PORTS}")

if (NOT VCPKG_OVERLAY_TRIPLETS)
Expand Down
31 changes: 31 additions & 0 deletions extern/vcpkg/ports/ada-url/no-cpm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b206edb6..1db4099d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,7 +30,6 @@ option(ADA_TESTING "Build tests" ${BUILD_TESTING})
# errors due to CPM, so this is here to support disabling all the testing
# and tooling for ada if one only wishes to use the ada library.
if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)
- include(cmake/CPM.cmake)
# CPM requires git as an implicit dependency
find_package(Git QUIET)
# We use googletest in the tests
diff --git a/tools/cli/CMakeLists.txt b/tools/cli/CMakeLists.txt
index ff57220b..a6d90f29 100644
--- a/tools/cli/CMakeLists.txt
+++ b/tools/cli/CMakeLists.txt
@@ -8,12 +8,8 @@ if(MSVC AND BUILD_SHARED_LIBS)
"$<TARGET_FILE:ada>" # <--this is in-file
"$<TARGET_FILE_DIR:adaparse>") # <--this is out-file path
endif()
-CPMAddPackage("gh:fmtlib/fmt#10.2.1")
-CPMAddPackage(
- GITHUB_REPOSITORY jarro2783/cxxopts
- VERSION 3.2.0
- OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
-)
+find_package(fmt CONFIG REQUIRED)
+find_package(cxxopts CONFIG REQUIRED)
target_link_libraries(adaparse PRIVATE cxxopts::cxxopts fmt::fmt)

if(MSVC OR MINGW)
40 changes: 40 additions & 0 deletions extern/vcpkg/ports/ada-url/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ada-url/ada
REF "920a8b34c194a4f3930c20b62afaee45f071ea37"
SHA512 6e7d06cc9550fbe08984e835f7bbda4a322023e087425cf4e90a19ef019cedbe55df70cc6f61c21b771c7dae7ee1f56d3fcde3371206bac1adbe83dffa7cf032
HEAD_REF main
PATCHES
#no-cpm.patch
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools ADA_TOOLS
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DADA_BENCHMARKS=OFF
-DBUILD_TESTING=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DADA_TOOLS=OFF
)

vcpkg_cmake_install()

vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup(PACKAGE_NAME ada CONFIG_PATH "lib/cmake/ada")

if("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES adaparse AUTO_CLEAN)
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE-APACHE" "${SOURCE_PATH}/LICENSE-MIT")
27 changes: 27 additions & 0 deletions extern/vcpkg/ports/ada-url/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "ada-url",
"version": "2.9.2-plus",
"description": "WHATWG-compliant and fast URL parser written in modern C++",
"homepage": "https://ada-url.com/",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tools": {
"description": "Build CLI tools (adaparse)",
"supports": "!uwp",
"dependencies": [
"cxxopts",
"fmt"
]
}
}
}
Loading