diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/tomlplusplus | |
Diffstat (limited to 'vcpkg/ports/tomlplusplus')
| -rw-r--r-- | vcpkg/ports/tomlplusplus/fix-android-fileapi.patch | 17 | ||||
| -rw-r--r-- | vcpkg/ports/tomlplusplus/portfile.cmake | 39 | ||||
| -rw-r--r-- | vcpkg/ports/tomlplusplus/vcpkg.json | 19 |
3 files changed, 75 insertions, 0 deletions
diff --git a/vcpkg/ports/tomlplusplus/fix-android-fileapi.patch b/vcpkg/ports/tomlplusplus/fix-android-fileapi.patch new file mode 100644 index 0000000..7d78bf7 --- /dev/null +++ b/vcpkg/ports/tomlplusplus/fix-android-fileapi.patch @@ -0,0 +1,17 @@ +diff --git a/include/toml++/impl/parser.inl b/include/toml++/impl/parser.inl +index 6f0136f..be37f0d 100644 +--- a/include/toml++/impl/parser.inl ++++ b/include/toml++/impl/parser.inl +@@ -23,6 +23,12 @@ + #include "unicode.hpp" + TOML_DISABLE_WARNINGS; + #include <istream> ++ ++#if defined(__ANDROID_API__) && __ANDROID_API__ < 24 ++ // Cf. https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md#32_bit-and ++ #define ftello ftell ++ #define fseeko fseek ++#endif + #include <fstream> + #if TOML_INT_CHARCONV || TOML_FLOAT_CHARCONV + #include <charconv> diff --git a/vcpkg/ports/tomlplusplus/portfile.cmake b/vcpkg/ports/tomlplusplus/portfile.cmake new file mode 100644 index 0000000..49eb9c8 --- /dev/null +++ b/vcpkg/ports/tomlplusplus/portfile.cmake @@ -0,0 +1,39 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO marzer/tomlplusplus + REF "v${VERSION}" + SHA512 c227fc8147c9459b29ad24002aaf6ab2c42fac22ea04c1c52b283a0172581ccd4527b33c1931e0ef0d1db6b6a53f9e9882c6d4231c7f3494cf070d0220741aa5 + HEAD_REF master + PATCHES + fix-android-fileapi.patch +) + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Dbuild_tests=false + -Dbuild_examples=false +) + +vcpkg_install_meson() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tomlplusplus) +# Fixup link lib name and multi-config +find_library(lib NAMES tomlplusplus PATHS "${CURRENT_PACKAGES_DIR}/lib" NO_DEFAULT_PATH REQUIRED) +cmake_path(GET lib FILENAME name) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/tomlplusplus/tomlplusplusConfig.cmake" + [[(IMPORTED_LOCATION "..PACKAGE_PREFIX_DIR./lib/)[^"]*"]] + " \\1${name}\"" + REGEX +) +if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/tomlplusplus/tomlplusplusConfig.cmake" + [[IMPORTED_LOCATION ("..PACKAGE_PREFIX_DIR.)(/lib/[^"]*")]] + [[IMPORTED_CONFIGURATIONS "DEBUG;RELEASE" + IMPORTED_LOCATION_DEBUG \1/debug\2 + IMPORTED_LOCATION_RELEASE \1\2]] + REGEX + ) +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/tomlplusplus/vcpkg.json b/vcpkg/ports/tomlplusplus/vcpkg.json new file mode 100644 index 0000000..b981492 --- /dev/null +++ b/vcpkg/ports/tomlplusplus/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "tomlplusplus", + "version": "3.4.0", + "port-version": 1, + "description": "Header-only TOML config file parser and serializer for modern C++.", + "homepage": "https://marzer.github.io/tomlplusplus/", + "license": "MIT", + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake-config", + "host": true + }, + { + "name": "vcpkg-tool-meson", + "host": true + } + ] +} |