[msdfgen] New port (#15427)

* initial

* format

* Update ports/msdfgen/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/msdfgen/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* using vcpkg_copy_tools

* Compromise between renameing and UWP

* added feature "tools"

* forgot a check

* Update ports/msdfgen/portfile.cmake

* Update port_versions

* Add msdfgen.json in port_versions

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
This commit is contained in:
Haeri 2021-01-17 04:33:51 +01:00 committed by GitHub
parent f89336d703
commit 083c86d05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 86 additions and 0 deletions

View File

@ -3848,6 +3848,10 @@
"baseline": "3.1.0", "baseline": "3.1.0",
"port-version": 0 "port-version": 0
}, },
"msdfgen": {
"baseline": "1.8",
"port-version": 0
},
"msgpack": { "msgpack": {
"baseline": "3.3.0", "baseline": "3.3.0",
"port-version": 0 "port-version": 0

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "8b15da4b26ea13caeba60337d49e6d5ec17c3e11",
"version-string": "1.8",
"port-version": 0
}
]
}

View File

@ -0,0 +1,15 @@
diff --git a/ext/import-font.cpp b/ext/import-font.cpp
index 8f23620..ed26f54 100644
--- a/ext/import-font.cpp
+++ b/ext/import-font.cpp
@@ -7,10 +7,6 @@
#include FT_FREETYPE_H
#include FT_OUTLINE_H
-#ifdef _WIN32
- #pragma comment(lib, "freetype.lib")
-#endif
-
namespace msdfgen {
#define REQUIRE(cond) { if (!(cond)) return false; }

View File

@ -0,0 +1,44 @@
# No symbols are exported in msdfgen source
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Chlumsky/msdfgen
REF 9af250c7d6780a41dcaf536c05e3e1987a1bdcd7
SHA512 6b1dadd386aedf1e2de927dc83fe1f7fd7e053b0e9829ea0609a193ab8d9f92ecf08d2a6225b76a4f7bf9344b2935f38bbd00c4cc0c6627c1d95f67d2db728fe
HEAD_REF master
PATCHES
compatibility.patch
)
set(BUILD_TOOLS OFF)
if ("tools" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_UWP)
message("Tools couldn't be built on UWP, disable it automatically.")
else()
set(BUILD_TOOLS ON)
endif()
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DMSDFGEN_BUILD_MSDFGEN_STANDALONE=${BUILD_TOOLS}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/msdfgen)
# move exe to tools
if(BUILD_TOOLS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_copy_tools(TOOL_NAMES msdfgen AUTO_CLEAN)
endif()
# cleanup
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# license
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

14
ports/msdfgen/vcpkg.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "msdfgen",
"version-string": "1.8",
"description": "Multi-channel signed distance field generator",
"homepage": "https://github.com/Chlumsky/msdfgen",
"dependencies": [
"freetype"
],
"features": {
"tools": {
"description": "Generates an executable inside the tools folder. Not supported on UWP."
}
}
}