aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Kranjc <blaz.kranjc91@gmail.com>2021-01-08 21:01:00 +0100
committerGitHub <noreply@github.com>2021-01-08 12:01:00 -0800
commit1ef1ed0d82c7418b5314cf334b67afd1762e90d2 (patch)
treebde7ad1b9997514de858dbc828a33912770a126d
parent271f58aa0c89cfbf066e1679531c5b02c605ee42 (diff)
downloadvcpkg-1ef1ed0d82c7418b5314cf334b67afd1762e90d2.tar.gz
vcpkg-1ef1ed0d82c7418b5314cf334b67afd1762e90d2.zip
[type-safe] New port. (#15468)
* [type-safe] New port. [debug-assert] Added as it is a dependency. * [type-safe] Formatting fix. * [debug-assert] Add homepage to vcpkg.json Co-authored-by: Blaž Kranjc <bkranjc@cosylab.lan>
-rw-r--r--ports/debug-assert/portfile.cmake24
-rw-r--r--ports/debug-assert/vcpkg.json6
-rw-r--r--ports/type-safe/disable_tests.patch12
-rw-r--r--ports/type-safe/portfile.cmake26
-rw-r--r--ports/type-safe/vcpkg.json9
5 files changed, 77 insertions, 0 deletions
diff --git a/ports/debug-assert/portfile.cmake b/ports/debug-assert/portfile.cmake
new file mode 100644
index 000000000..41f9385ff
--- /dev/null
+++ b/ports/debug-assert/portfile.cmake
@@ -0,0 +1,24 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO foonathan/debug_assert
+ REF 0144b6532ec80349780ffac3cf85a92d87eb7b1b
+ SHA512 16cf38406d5f71585b763ff8af59b09c7b8b05372b07714cdc82f6f27292597c0b6d9025f823515744f8235b326b95e1d630af34db4a0e15d4ded79364290630
+ HEAD_REF v1.3.3
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DDEBUG_ASSERT_INSTALL=ON
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/debug_assert TARGET_PATH share/debug_assert)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
+
+vcpkg_copy_pdbs()
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/debug-assert/vcpkg.json b/ports/debug-assert/vcpkg.json
new file mode 100644
index 000000000..413b23d30
--- /dev/null
+++ b/ports/debug-assert/vcpkg.json
@@ -0,0 +1,6 @@
+{
+ "name": "debug-assert",
+ "version-string": "1.3.3",
+ "description": "Provides flexible DEBUG_ASSERT() macro.",
+ "homepage": "https://github.com/foonathan/debug_assert"
+}
diff --git a/ports/type-safe/disable_tests.patch b/ports/type-safe/disable_tests.patch
new file mode 100644
index 000000000..f18d2ebbf
--- /dev/null
+++ b/ports/type-safe/disable_tests.patch
@@ -0,0 +1,12 @@
+diff -ur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -136,7 +136,7 @@
+ # other subdirectories
+ # only add if not inside add_subdirectory()
+ option(TYPE_SAFE_BUILD_TEST_EXAMPLE "build test and example" OFF)
+-if(${TYPE_SAFE_BUILD_TEST_EXAMPLE} OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
++if(${TYPE_SAFE_BUILD_TEST_EXAMPLE})
+ enable_testing()
+ add_subdirectory(example/)
+ add_subdirectory(test/)
diff --git a/ports/type-safe/portfile.cmake b/ports/type-safe/portfile.cmake
new file mode 100644
index 000000000..8930f3f92
--- /dev/null
+++ b/ports/type-safe/portfile.cmake
@@ -0,0 +1,26 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO foonathan/type_safe
+ REF da1d15abc612afbdc81d70c817b49ba1752177de
+ SHA512 5b344af89378e34f05d96bff2de61615bc16e21601d9fe9d0886c71db211bd3b42afb2467dd2eb7f3d11176dc9adc2d71c6dc0b60722e12aaf8c1d79ea869289
+ HEAD_REF v0.2.1
+ PATCHES
+ disable_tests.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DTYPE_SAFE_BUILD_TEST_EXAMPLE=OFF
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/type_safe TARGET_PATH share/type_safe)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug ${CURRENT_PACKAGES_DIR}/lib)
+
+vcpkg_copy_pdbs()
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/ports/type-safe/vcpkg.json b/ports/type-safe/vcpkg.json
new file mode 100644
index 000000000..3b16d3c7b
--- /dev/null
+++ b/ports/type-safe/vcpkg.json
@@ -0,0 +1,9 @@
+{
+ "name": "type-safe",
+ "version-string": "0.2.1",
+ "description": "Zero overhead abstractions that use the C++ type system to prevent bugs.",
+ "homepage": "https://github.com/foonathan/type_safe",
+ "dependencies": [
+ "debug-assert"
+ ]
+}