From 3508985146f1b1d248c67ead13f8f54be5b4f5da Mon Sep 17 00:00:00 2001 From: Pantelis Lekakis Date: Fri, 23 Aug 2024 11:26:17 +0100 Subject: [PATCH] [hlslpp] Add new port (#40400) Co-authored-by: jim wang <122244446+jimwang118@users.noreply.github.com> Co-authored-by: Kai Pastor --- ports/hlslpp/hlslpp-config.cmake | 2 ++ ports/hlslpp/portfile.cmake | 19 +++++++++++++++++++ ports/hlslpp/usage | 4 ++++ ports/hlslpp/vcpkg.json | 18 ++++++++++++++++++ versions/baseline.json | 4 ++++ versions/h-/hlslpp.json | 9 +++++++++ 6 files changed, 56 insertions(+) create mode 100644 ports/hlslpp/hlslpp-config.cmake create mode 100644 ports/hlslpp/portfile.cmake create mode 100644 ports/hlslpp/usage create mode 100644 ports/hlslpp/vcpkg.json create mode 100644 versions/h-/hlslpp.json diff --git a/ports/hlslpp/hlslpp-config.cmake b/ports/hlslpp/hlslpp-config.cmake new file mode 100644 index 00000000000000..81d6d997c321d9 --- /dev/null +++ b/ports/hlslpp/hlslpp-config.cmake @@ -0,0 +1,2 @@ +add_library(unofficial::hlslpp::hlslpp INTERACE IMPORTED) +target_include_directories(unofficial::hlslpp::hlslpp INTERFACE "${CMAKE_CURRENT_LIST_DIR}/../../include/hlslpp") diff --git a/ports/hlslpp/portfile.cmake b/ports/hlslpp/portfile.cmake new file mode 100644 index 00000000000000..4983d438a8607f --- /dev/null +++ b/ports/hlslpp/portfile.cmake @@ -0,0 +1,19 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO redorav/hlslpp + REF "${VERSION}" + SHA512 79b1464eb6441ec720b9952e80d7fbdb67852f7770fbe6ec2c67736627e62292f9d23dfcc9b1d548b6c33b75a7b2e911fa757fe087d7360bc7e72867d7f2c7a8 + HEAD_REF master +) + +file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}/include/") +file(RENAME "${CURRENT_PACKAGES_DIR}/include/include" "${CURRENT_PACKAGES_DIR}/include/hlslpp") + +# Copy and rename License -> copyright. +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +# Copy the cmake config file, which is used to setup the imported target. +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/${PORT}-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +# Copy and show the usage. +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/ports/hlslpp/usage b/ports/hlslpp/usage new file mode 100644 index 00000000000000..b7b4da5f9ed806 --- /dev/null +++ b/ports/hlslpp/usage @@ -0,0 +1,4 @@ +hlslpp provides a CMake package: + + find_package(unofficial-hlslpp CONFIG REQUIRED) + target_link_libraries(main PUBLIC unofficial::hlslpp::hlslpp) diff --git a/ports/hlslpp/vcpkg.json b/ports/hlslpp/vcpkg.json new file mode 100644 index 00000000000000..12970ccb2d141b --- /dev/null +++ b/ports/hlslpp/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "hlslpp", + "version": "3.5", + "description": "Math library using HLSL syntax with multiplatform SIMD support.", + "homepage": "https://github.com/redorav/hlslpp", + "license": "MIT", + "supports": "!x86", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 62f9bfefdd5481..b7605dc840db99 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3464,6 +3464,10 @@ "baseline": "2.4.1", "port-version": 0 }, + "hlslpp": { + "baseline": "3.5", + "port-version": 0 + }, "hnswlib": { "baseline": "0.8.0", "port-version": 0 diff --git a/versions/h-/hlslpp.json b/versions/h-/hlslpp.json new file mode 100644 index 00000000000000..6bf347a83fe5b6 --- /dev/null +++ b/versions/h-/hlslpp.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "441df83e907bfc42eedda5b2e502e627519b3a8a", + "version": "3.5", + "port-version": 0 + } + ] +}