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/scripts/test_ports/vcpkg-ci-tomlplusplus | |
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus')
4 files changed, 62 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/portfile.cmake new file mode 100644 index 0000000..dd25706 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/portfile.cmake @@ -0,0 +1,10 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" +) +vcpkg_cmake_build() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/CMakeLists.txt new file mode 100644 index 0000000..4a54d5b --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.30) +project(tomlplusplus-test CXX) + + +find_package(tomlplusplus CONFIG REQUIRED) + +add_executable(main main.cpp) +target_link_libraries(main PRIVATE tomlplusplus::tomlplusplus) + + +find_package(PkgConfig REQUIRED) +pkg_check_modules(tomlplusplus_pc tomlplusplus REQUIRED IMPORTED_TARGET) + +add_executable(main-pkconfig main.cpp) +target_compile_features(main-pkconfig PRIVATE cxx_std_17) +target_link_libraries(main-pkconfig PRIVATE PkgConfig::tomlplusplus_pc) diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/main.cpp b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/main.cpp new file mode 100644 index 0000000..3382010 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/project/main.cpp @@ -0,0 +1,22 @@ +#include <iostream> +#include <toml++/toml.hpp> + +int main(int argc, char** argv) +{ + if (argc < 2) + return 1; + + try + { + toml::table tbl; + tbl = toml::parse_file(argv[1]); + std::cout << tbl << "\n"; + } + catch (const toml::parse_error& err) + { + std::cerr << "Parsing failed: " << err << "\n"; + return 2; + } + + return 0; +} diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/vcpkg.json new file mode 100644 index 0000000..155989e --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-tomlplusplus/vcpkg.json @@ -0,0 +1,14 @@ +{ + "name": "vcpkg-ci-tomlplusplus", + "version-string": "ci", + "description": "Port to force features of tomlplusplus within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + "tomlplusplus", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |