Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[type-safe] New port. #15468

Merged
merged 3 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ports/debug-assert/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 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)
6 changes: 6 additions & 0 deletions ports/debug-assert/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 12 additions & 0 deletions ports/type-safe/disable_tests.patch
Original file line number Diff line number Diff line change
@@ -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/)
26 changes: 26 additions & 0 deletions ports/type-safe/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions ports/type-safe/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
]
}