Skip to content

Commit

Permalink
[harfbuzz] add new CMake target and new feature (microsoft#38182)
Browse files Browse the repository at this point in the history
Fixes microsoft#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 <[email protected]>
Co-authored-by: Jon <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2024
1 parent 43de6ac commit 6c87aab
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
28 changes: 28 additions & 0 deletions ports/harfbuzz/harfbuzzConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 7 additions & 0 deletions ports/harfbuzz/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 changes: 4 additions & 0 deletions ports/harfbuzz/usage
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions ports/harfbuzz/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -39,6 +40,9 @@
"description": "Enable DirectWrite support on Windows",
"supports": "windows"
},
"experimental-api": {
"description": "Enable experimental api"
},
"freetype": {
"description": "Enable FreeType support",
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3342,7 +3342,7 @@
},
"harfbuzz": {
"baseline": "8.4.0",
"port-version": 0
"port-version": 1
},
"hash-library": {
"baseline": "8",
Expand Down
5 changes: 5 additions & 0 deletions versions/h-/harfbuzz.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "cf348ecae022fb9ccfd58be64fcd90008e1fb74d",
"version": "8.4.0",
"port-version": 1
},
{
"git-tree": "88ea94a9bb416c379a7df3049fca28f0d1fdc933",
"version": "8.4.0",
Expand Down

0 comments on commit 6c87aab

Please sign in to comment.