diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/unicorn-lib | |
Diffstat (limited to 'vcpkg/ports/unicorn-lib')
| -rw-r--r-- | vcpkg/ports/unicorn-lib/CMakeLists.txt | 32 | ||||
| -rw-r--r-- | vcpkg/ports/unicorn-lib/fix-missing-headers.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/unicorn-lib/portfile.cmake | 28 | ||||
| -rw-r--r-- | vcpkg/ports/unicorn-lib/vcpkg.json | 28 |
4 files changed, 100 insertions, 0 deletions
diff --git a/vcpkg/ports/unicorn-lib/CMakeLists.txt b/vcpkg/ports/unicorn-lib/CMakeLists.txt new file mode 100644 index 0000000..4f0879e --- /dev/null +++ b/vcpkg/ports/unicorn-lib/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.10) + +project(Unicorn_Lib LANGUAGES CXX DESCRIPTION "Unicode library for C++ by Ross Smith") +set(CMAKE_CXX_STANDARD 17) +option(UNICORN_LIB_SKIP_HEADERS "If the headers installation is skipped or not." OFF) + +find_package(ZLIB REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(PCRE2 IMPORTED_TARGET REQUIRED libpcre2-8) + +file(GLOB_RECURSE UNICORN_LIB_SOURCES "${PROJECT_SOURCE_DIR}/unicorn/*.cpp") +list(FILTER UNICORN_LIB_SOURCES EXCLUDE REGEX "(.*)-test.cpp(.*)") + +add_library(unicorn-lib ${UNICORN_LIB_SOURCES}) +target_include_directories(unicorn-lib PUBLIC "${PROJECT_SOURCE_DIR}") +target_link_libraries(unicorn-lib PRIVATE PkgConfig::PCRE2 ZLIB::ZLIB) +if(WIN32) + target_compile_definitions(unicorn-lib PRIVATE -DNOMINMAX -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS) +else() + find_package(Iconv REQUIRED) + target_link_libraries(unicorn-lib PRIVATE Iconv::Iconv) + target_compile_definitions(unicorn-lib PRIVATE -D_XOPEN_SOURCE=700) +endif() + +if(NOT UNICORN_LIB_SKIP_HEADERS) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/unicorn DESTINATION include FILES_MATCHING PATTERN "*.hpp") +endif() +install(TARGETS unicorn-lib + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + )
\ No newline at end of file diff --git a/vcpkg/ports/unicorn-lib/fix-missing-headers.patch b/vcpkg/ports/unicorn-lib/fix-missing-headers.patch new file mode 100644 index 0000000..a64103a --- /dev/null +++ b/vcpkg/ports/unicorn-lib/fix-missing-headers.patch @@ -0,0 +1,12 @@ +diff --git a/unicorn/utility.hpp b/unicorn/utility.hpp +index e6a57b7..a2afa58 100644 +--- a/unicorn/utility.hpp ++++ b/unicorn/utility.hpp +@@ -54,6 +54,7 @@ + #include <istream> + #include <iterator> + #include <limits> ++#include <memory> + #include <mutex> + #include <new> + #include <optional> diff --git a/vcpkg/ports/unicorn-lib/portfile.cmake b/vcpkg/ports/unicorn-lib/portfile.cmake new file mode 100644 index 0000000..d953711 --- /dev/null +++ b/vcpkg/ports/unicorn-lib/portfile.cmake @@ -0,0 +1,28 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO CaptainCrowbar/unicorn-lib + REF 44e975ffc8dcd8dedbe01a8cbe7812e351f3f74f # 2021-10-28 + SHA512 b22264420174c950ca8025e861366118d79a53edce9297d84af9511e255af5971c3719f0b464f4a4886848edea7c2ba4ae32ce9abab135628d64adbde5fa7b0d + HEAD_REF master + PATCHES + fix-missing-headers.patch # https://github.com/CaptainCrowbar/unicorn-lib/pull/10 +) + +file(COPY "${CURRENT_PORT_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + OPTIONS_DEBUG + -DUNICORN_LIB_SKIP_HEADERS=ON +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/unicorn-lib/vcpkg.json b/vcpkg/ports/unicorn-lib/vcpkg.json new file mode 100644 index 0000000..46c98ef --- /dev/null +++ b/vcpkg/ports/unicorn-lib/vcpkg.json @@ -0,0 +1,28 @@ +{ + "name": "unicorn-lib", + "version-date": "2022-01-24", + "port-version": 2, + "description": "Unicode library for C++ by Ross Smith", + "homepage": "https://github.com/CaptainCrowbar/unicorn-lib", + "license": "MIT", + "supports": "!uwp", + "dependencies": [ + { + "name": "libiconv", + "platform": "!windows" + }, + { + "name": "pcre2", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "zlib" + ] +} |