[harfbuzz] add new CMake target and new feature (#38182)

Fixes #38181.

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [x] The "supports" clause reflects platforms that may be fixed by this
new version.
- [x] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

Add new CMake target `harfbuzz::harfbuzz-subset` and new feature
`experimental-api`

---------

Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com>
Co-authored-by: Jon <v-zhli17@microsoft.com>
This commit is contained in:
wyzdwdz 2024-04-19 01:52:41 +02:00 committed by GitHub
parent 43de6acd6f
commit 6c87aab05c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 49 additions and 1 deletions

View File

@ -72,3 +72,31 @@ if ("icu" IN_LIST HARFBUZZ_FEATURES)
find_dependency(ICU 61 COMPONENTS uc)
target_link_libraries(harfbuzz INTERFACE ICU::uc)
endif()
add_library(harfbuzz::harfbuzz-subset UNKNOWN IMPORTED)
find_library(HARFBUZZ_SUBSET_LIBRARY_DEBUG
NAMES harfbuzz-subset
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug"
PATH_SUFFIXES lib NO_DEFAULT_PATH)
find_library(HARFBUZZ_SUBSET_LIBRARY_RELEASE
NAMES harfbuzz-subset
PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}"
PATH_SUFFIXES lib NO_DEFAULT_PATH)
if(NOT HARFBUZZ_LIBRARY_DEBUG)
set_target_properties(harfbuzz::harfbuzz-subset PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS "RELEASE"
IMPORTED_LOCATION_RELEASE "${HARFBUZZ_SUBSET_LIBRARY_RELEASE}"
)
else()
set_target_properties(harfbuzz::harfbuzz-subset PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIR}"
IMPORTED_CONFIGURATIONS "DEBUG;RELEASE"
IMPORTED_LOCATION_RELEASE "${HARFBUZZ_SUBSET_LIBRARY_RELEASE}"
IMPORTED_LOCATION_DEBUG "${HARFBUZZ_SUBSET_LIBRARY_DEBUG}"
)
endif()
target_link_libraries(harfbuzz::harfbuzz-subset INTERFACE harfbuzz)

View File

@ -46,6 +46,11 @@ if("freetype" IN_LIST FEATURES)
else()
list(APPEND FEATURE_OPTIONS -Dfreetype=disabled)
endif()
if("experimental-api" IN_LIST FEATURES)
list(APPEND FEATURE_OPTIONS -Dexperimental_api=true) #Enable experimental api
else()
list(APPEND FEATURE_OPTIONS -Dexperimental_api=false)
endif()
#if(VCPKG_TARGET_IS_WINDOWS)
#link errors in qt5-base. probably requires changes to the pc files generated by meson
#list(APPEND FEATURE_OPTIONS -Dgdi=enabled) # enable gdi helpers and uniscribe shaper backend (windows only)
@ -123,3 +128,5 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
endif()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

4
ports/harfbuzz/usage Normal file
View File

@ -0,0 +1,4 @@
The harfbuzz package provides CMake targets:
find_package(harfbuzz CONFIG REQUIRED)
target_link_libraries(main PRIVATE harfbuzz::harfbuzz harfbuzz::harfbuzz-subset)

View File

@ -1,6 +1,7 @@
{
"name": "harfbuzz",
"version": "8.4.0",
"port-version": 1,
"description": "HarfBuzz OpenType text shaping engine",
"homepage": "https://github.com/harfbuzz/harfbuzz",
"license": "MIT-Modern-Variant",
@ -39,6 +40,9 @@
"description": "Enable DirectWrite support on Windows",
"supports": "windows"
},
"experimental-api": {
"description": "Enable experimental api"
},
"freetype": {
"description": "Enable FreeType support",
"dependencies": [

View File

@ -3342,7 +3342,7 @@
},
"harfbuzz": {
"baseline": "8.4.0",
"port-version": 0
"port-version": 1
},
"hash-library": {
"baseline": "8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cf348ecae022fb9ccfd58be64fcd90008e1fb74d",
"version": "8.4.0",
"port-version": 1
},
{
"git-tree": "88ea94a9bb416c379a7df3049fca28f0d1fdc933",
"version": "8.4.0",