diff options
| author | つむぎん <oishikazuki@gmail.com> | 2018-10-04 13:32:36 +0900 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-10-03 21:32:36 -0700 |
| commit | dabfd4e0227355229eb1355b866e16d325c0cde7 (patch) | |
| tree | 9e0486130bc7a3f7cbe36bd034110121208d84bb | |
| parent | 37b17780533da7a3e369bda90e044aed714f7033 (diff) | |
| download | vcpkg-dabfd4e0227355229eb1355b866e16d325c0cde7.tar.gz vcpkg-dabfd4e0227355229eb1355b866e16d325c0cde7.zip | |
[tinyutf8] Initial port for tinyutf8. (#4388)
* Add tinyutf8 port.
* [tinyutf8] Use vcpkg_from_github(). Simplify patch.
| -rw-r--r-- | ports/tinyutf8/CONTROL | 3 | ||||
| -rw-r--r-- | ports/tinyutf8/fixbuild.patch | 29 | ||||
| -rw-r--r-- | ports/tinyutf8/portfile.cmake | 29 |
3 files changed, 61 insertions, 0 deletions
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)
|
