Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 17 commits into from
Apr 18, 2024
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}")
6 changes: 6 additions & 0 deletions ports/harfbuzz/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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": [

Check failure on line 2 in versions/h-/harfbuzz.json

View check run for this annotation

Azure Pipelines / microsoft.vcpkg.pr (x86_windows)

versions/h-/harfbuzz.json#L2

versions/h-/harfbuzz.json(2,): error : while parsing versions for harfbuzz from version/h-/harfbuzz.json
{
"git-tree": "6fee18d75e1cab0c856efd86d4b4934a911d1b09",
"version": "8.4.0",
"port-version": 1
},
{
"git-tree": "88ea94a9bb416c379a7df3049fca28f0d1fdc933",
"version": "8.4.0",
Expand Down
Loading