Skip to content

Commit

Permalink
[dyno] add new port (microsoft#34684)
Browse files Browse the repository at this point in the history
* [dyno] add new port

* [dyno] add new port
  • Loading branch information
jiayuehua authored Oct 29, 2023
1 parent ff9b47f commit 06c79a9
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ports/dyno/fix-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c7c421..1b8b2bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,9 +14,8 @@ add_library(dyno INTERFACE)
add_library(Dyno::dyno ALIAS dyno)
target_compile_features(dyno INTERFACE cxx_std_17)
target_include_directories(dyno INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
-find_package(Hana REQUIRED)
-find_package(CallableTraits REQUIRED)
-target_link_libraries(dyno INTERFACE hana callable_traits)
+find_package(Boost REQUIRED)
+target_link_libraries(dyno INTERFACE Boost::boost)

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-gnu-string-literal-operator-template" DYNO_HAS_WNO_GNU_STRING_UDL)
diff --git a/cmake/dyno-config.cmake b/cmake/dyno-config.cmake
index 8a1845b..57aa7a1 100644
--- a/cmake/dyno-config.cmake
+++ b/cmake/dyno-config.cmake
@@ -3,8 +3,7 @@
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

include(CMakeFindDependencyMacro)
-find_dependency(Hana REQUIRED)
-find_dependency(CallableTraits REQUIRED)
+find_dependency(Boost)

if(NOT TARGET Dyno::dyno)
include("${CMAKE_CURRENT_LIST_DIR}/dyno-targets.cmake")
24 changes: 24 additions & 0 deletions ports/dyno/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ldionne/dyno
REF 56ced251f5751ef4e3fe66d4f28ccbc75b902d70
SHA512 c3f34679d1e2f3cec3757f69662d4f5db602b9028a927ad9070e70813caf18bb2a512f148e69f14aaac35a3e13abb57e1aa8e4f369993e7a01d048d70050daa6
HEAD_REF master
PATCHES fix-deps.patch
)

set(VCPKG_BUILD_TYPE release) #header-only library

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME dyno CONFIG_PATH "lib/cmake/dyno")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
5 changes: 5 additions & 0 deletions ports/dyno/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The package dyno provides CMake targets:

find_package(dyno CONFIG REQUIRED)
target_link_libraries(main PRIVATE Dyno::dyno)

19 changes: 19 additions & 0 deletions ports/dyno/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "dyno",
"version-date": "2019-11-13",
"description": "Runtime polymorphism done right",
"homepage": "https://github.com/ldionne/dyno/",
"license": "BSL-1.0",
"dependencies": [
"boost-callable-traits",
"boost-hana",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2308,6 +2308,10 @@
"baseline": "2.2.1",
"port-version": 0
},
"dyno": {
"baseline": "2019-11-13",
"port-version": 0
},
"eabase": {
"baseline": "2.09.12",
"port-version": 3
Expand Down
9 changes: 9 additions & 0 deletions versions/d-/dyno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "3af5237e2f59d877c47c333a5c006eae66f9d00c",
"version-date": "2019-11-13",
"port-version": 0
}
]
}

0 comments on commit 06c79a9

Please sign in to comment.