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-mapbox-variant | |
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant')
4 files changed, 41 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/portfile.cmake new file mode 100644 index 0000000..8a2079b --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/portfile.cmake @@ -0,0 +1,5 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" +) +vcpkg_cmake_build() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt new file mode 100644 index 0000000..79c30f2 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.25.1)
+project(mapbox-variant-test LANGUAGES CXX)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+find_package(unofficial-mapbox-variant CONFIG REQUIRED)
+add_executable(main main.cpp)
+target_link_libraries(main PRIVATE unofficial::mapbox-variant::variant)
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp new file mode 100644 index 0000000..1f59c1a --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/project/main.cpp @@ -0,0 +1,17 @@ +#include <mapbox/variant.hpp>
+#include <stdexcept>
+struct check
+{
+ template <typename T>
+ void operator()(T const& val) const
+ {
+ if (val != 0) throw std::runtime_error("invalid");
+ }
+};
+int main()
+{
+ typedef mapbox::util::variant<bool, int, double> variant_type;
+ variant_type v(0);
+ mapbox::util::apply_visitor(check(), v);
+ return 0;
+}
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/vcpkg.json new file mode 100644 index 0000000..3cdcb61 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-mapbox-variant/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "vcpkg-ci-mapbox-variant", + "version-string": "ci", + "description": "Validates mapbox-variant", + "dependencies": [ + "mapbox-variant", + { + "name": "vcpkg-cmake", + "host": true + } + ] +} |