diff options
| -rw-r--r-- | ports/tiny-bignum-c/CMakeLists.txt | 28 | ||||
| -rw-r--r-- | ports/tiny-bignum-c/CONTROL | 4 | ||||
| -rw-r--r-- | ports/tiny-bignum-c/portfile.cmake | 30 |
3 files changed, 62 insertions, 0 deletions
diff --git a/ports/tiny-bignum-c/CMakeLists.txt b/ports/tiny-bignum-c/CMakeLists.txt new file mode 100644 index 000000000..8891356d7 --- /dev/null +++ b/ports/tiny-bignum-c/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.14)
+
+project(tiny-bignum-c LANGUAGES C)
+
+include(GNUInstallDirs)
+
+add_library(tiny-bignum-c bn.c)
+
+target_include_directories(
+ tiny-bignum-c
+ PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+target_compile_definitions(
+ tiny-bignum-c
+ PRIVATE
+ $<$<C_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>
+)
+set_target_properties(tiny-bignum-c PROPERTIES PUBLIC_HEADER bn.h)
+
+install(TARGETS tiny-bignum-c EXPORT unofficial-tiny-bignum-c-config)
+
+install(
+ EXPORT unofficial-tiny-bignum-c-config
+ NAMESPACE unofficial::tiny-bignum-c::
+ DESTINATION share/unofficial-tiny-bignum-c
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+)
diff --git a/ports/tiny-bignum-c/CONTROL b/ports/tiny-bignum-c/CONTROL new file mode 100644 index 000000000..5015bc2d0 --- /dev/null +++ b/ports/tiny-bignum-c/CONTROL @@ -0,0 +1,4 @@ +Source: tiny-bignum-c
+Version: 2019-07-31
+Description: Small portable multiple-precision unsigned integer arithmetic in C
+Homepage: https://github.com/kokke/tiny-bignum-c
diff --git a/ports/tiny-bignum-c/portfile.cmake b/ports/tiny-bignum-c/portfile.cmake new file mode 100644 index 000000000..732271241 --- /dev/null +++ b/ports/tiny-bignum-c/portfile.cmake @@ -0,0 +1,30 @@ +include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kokke/tiny-bignum-c
+ REF e814d2b6b522ecaa67701453c492811a8adbc555
+ SHA512 2cea21588d018bd74fb9a128576764feecd87364d157acee21bd37cd8890c0776b228e25580de88a0c6d723a7b8e88cb8120c8c66b3999661c707b04dffc3f5b
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# Handle copyright
+configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
+
+# CMake integration test
+vcpkg_test_cmake(PACKAGE_NAME unofficial-${PORT})
|
