From dabfd4e0227355229eb1355b866e16d325c0cde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A4=E3=82=80=E3=81=8E=E3=82=93?= Date: Thu, 4 Oct 2018 13:32:36 +0900 Subject: [tinyutf8] Initial port for tinyutf8. (#4388) * Add tinyutf8 port. * [tinyutf8] Use vcpkg_from_github(). Simplify patch. --- ports/tinyutf8/CONTROL | 3 +++ ports/tinyutf8/fixbuild.patch | 29 +++++++++++++++++++++++++++++ ports/tinyutf8/portfile.cmake | 29 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 ports/tinyutf8/CONTROL create mode 100644 ports/tinyutf8/fixbuild.patch create mode 100644 ports/tinyutf8/portfile.cmake (limited to 'ports/tinyutf8') diff --git a/ports/tinyutf8/CONTROL b/ports/tinyutf8/CONTROL new file mode 100644 index 000000000..e67cee3fc --- /dev/null +++ b/ports/tinyutf8/CONTROL @@ -0,0 +1,3 @@ +Source: tinyutf8 +Version: 2.1.1-1 +Description: TINYUTF8 is a library for extremely easy integration of Unicode into an arbitrary C++11 project. diff --git a/ports/tinyutf8/fixbuild.patch b/ports/tinyutf8/fixbuild.patch new file mode 100644 index 000000000..c1798ada1 --- /dev/null +++ b/ports/tinyutf8/fixbuild.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4ec8787..cfea5b3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + cmake_minimum_required(VERSION 3.1) + project(tinyutf8) + +-set(CMAKE_CXX_STANDARD 11) ++set(CMAKE_CXX_STANDARD 17) + + option(TINYUTF8_BUILD_STATIC "Build as static library" On) + +@@ -14,3 +14,14 @@ endif() + add_library(tinyutf8 ${LIB_BUILD_TYPE} lib/tinyutf8.cpp) + + target_include_directories(tinyutf8 PUBLIC include) ++ ++if(MSVC) ++ ADD_DEFINITIONS(-D_UNICODE) ++endif() ++ ++install(TARGETS tinyutf8 ++ RUNTIME DESTINATION bin ++ ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib) ++ ++install(FILES include/tinyutf8.h DESTINATION include) +\ No newline at end of file diff --git a/ports/tinyutf8/portfile.cmake b/ports/tinyutf8/portfile.cmake new file mode 100644 index 000000000..c768260c9 --- /dev/null +++ b/ports/tinyutf8/portfile.cmake @@ -0,0 +1,29 @@ +include(vcpkg_common_functions) + +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO DuffsDevice/tinyutf8 + REF v2.1.1 + SHA512 0be9cebe1ac962c89e0620586d4f8d4f3059b52394e13506f19723855d146c35e6a1205ae5430a53ba95a89c60216054bfad9c4e8e8f1ec047f4096585de2efc + HEAD_REF master + PATCHES fixbuild.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" TINYUTF8_BUILD_STATIC) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS -DTINYUTF8_BUILD_STATIC=${TINYUTF8_BUILD_STATIC} +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENCE ${CURRENT_PACKAGES_DIR}/share/tinyutf8/copyright COPYONLY) + +# remove unneeded files +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -- cgit v1.2.3