diff --git a/ports/trieste/portfile.cmake b/ports/trieste/portfile.cmake new file mode 100644 index 0000000000..4408a3c112 --- /dev/null +++ b/ports/trieste/portfile.cmake @@ -0,0 +1,49 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO microsoft/Trieste + REF "v${VERSION}" + SHA512 cd92ef15181c7adc4e777342b9e5ae60ec1b12356d3742044d98e54d3f9a44012c377eafbc02f92afc7f80e963b32a22e5230f765a2f63345139050512bc3af0 + HEAD_REF main +) + +# NOTE: The CI overlay port (see .github/workflows/buildtest.yml, +# vcpkg-integration) uses sed to extract from the "if" line below onwards to +# build a portfile that points at the local checkout. If you reorder code above +# this line, update the sed pattern there. +if("parsers" IN_LIST FEATURES) + set(BUILD_PARSERS ON) + # The parser libraries lack __declspec(dllexport) annotations, + # so they must be built as static libraries on Windows. + if(VCPKG_TARGET_IS_WINDOWS) + set(VCPKG_LIBRARY_LINKAGE static) + endif() +else() + set(BUILD_PARSERS OFF) + # Without parsers, this is a header-only library. + set(VCPKG_BUILD_TYPE release) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DTRIESTE_USE_FETCH_CONTENT=OFF + -DTRIESTE_BUILD_SAMPLES=OFF + -DTRIESTE_BUILD_PARSERS=${BUILD_PARSERS} + -DTRIESTE_ENABLE_TESTING=OFF + -DTRIESTE_USE_SNMALLOC=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME trieste CONFIG_PATH share/trieste/cmake) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +if(NOT "parsers" IN_LIST FEATURES) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/trieste/usage b/ports/trieste/usage new file mode 100644 index 0000000000..e9f59fd64f --- /dev/null +++ b/ports/trieste/usage @@ -0,0 +1,9 @@ +trieste provides CMake targets: + + find_package(trieste CONFIG REQUIRED) + target_link_libraries( PRIVATE trieste::trieste) + +When installed with the "parsers" feature (vcpkg install trieste[parsers]): + + target_link_libraries( PRIVATE trieste::json) + target_link_libraries( PRIVATE trieste::yaml) diff --git a/ports/trieste/vcpkg.json b/ports/trieste/vcpkg.json new file mode 100644 index 0000000000..6508a3ab2f --- /dev/null +++ b/ports/trieste/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "trieste", + "version": "1.0.0", + "description": "A header-only C++20 term rewriting system for rapidly prototyping programming languages", + "homepage": "https://github.com/microsoft/Trieste", + "license": "MIT", + "supports": "!x86", + "dependencies": [ + "cli11", + "snmalloc", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "parsers": { + "description": "Build the JSON and YAML parser libraries (trieste::json, trieste::yaml)" + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 9c3946215e..8d612d6b92 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -10168,6 +10168,10 @@ "baseline": "1.1.0", "port-version": 0 }, + "trieste": { + "baseline": "1.0.0", + "port-version": 0 + }, "triton": { "baseline": "2025-02-15", "port-version": 0 diff --git a/versions/t-/trieste.json b/versions/t-/trieste.json new file mode 100644 index 0000000000..12aedf9f12 --- /dev/null +++ b/versions/t-/trieste.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "0adfdb1fb82a3c09110728d531d3abdc0cd81222", + "version": "1.0.0", + "port-version": 0 + } + ] +}