mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-05 05:56:53 +03:00
LibWeb: Get skia version constraint from vcpkg.json
This way we only have to update it in one place.
This commit is contained in:
parent
543b415b7d
commit
210e6edd9f
Notes:
sideshowbarker
2024-07-17 02:55:44 +09:00
Author: https://github.com/fgaz Commit: https://github.com/LadybirdBrowser/ladybird/commit/210e6edd9f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/382 Reviewed-by: https://github.com/ADKaster ✅
@ -761,7 +761,20 @@ if(unofficial-skia_FOUND)
|
||||
set(SKIA_LIBRARIES unofficial::skia::skia)
|
||||
else()
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(SKIA skia=124 REQUIRED)
|
||||
|
||||
# Get skia version from vcpkg.json
|
||||
file(READ ${LADYBIRD_SOURCE_DIR}/vcpkg.json VCPKG_DOT_JSON)
|
||||
string(JSON VCPKG_OVERRIDES_LENGTH LENGTH ${VCPKG_DOT_JSON} overrides)
|
||||
MATH(EXPR VCPKG_OVERRIDES_END_RANGE "${VCPKG_OVERRIDES_LENGTH}-1")
|
||||
foreach(IDX RANGE ${VCPKG_OVERRIDES_END_RANGE})
|
||||
string(JSON VCPKG_OVERRIDE_NAME GET ${VCPKG_DOT_JSON} overrides ${IDX} name)
|
||||
if(VCPKG_OVERRIDE_NAME STREQUAL "skia")
|
||||
string(JSON SKIA_REQUIRED_VERSION GET ${VCPKG_DOT_JSON} overrides ${IDX} version)
|
||||
string(REGEX MATCH "[0-9]+" SKIA_REQUIRED_VERSION ${SKIA_REQUIRED_VERSION})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
pkg_check_modules(SKIA skia=${SKIA_REQUIRED_VERSION} REQUIRED)
|
||||
target_include_directories(LibWeb PRIVATE ${SKIA_INCLUDE_DIRS})
|
||||
target_link_directories(LibWeb PRIVATE ${SKIA_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user