LibWeb: Allow using system skia

unofficial-skia is a vcpkg-specific package. With this change ladybird
can be built against skia as provided by system package managers such as
guix, mingw, and (soon) nix. All those packages include a .pc file, so
we use pkg-config.
This commit is contained in:
Francesco Gazzetta 2024-07-02 10:31:50 +02:00 committed by Andrew Kaster
parent 7da8a372df
commit 543b415b7d

View File

@ -754,11 +754,19 @@ set(GENERATED_SOURCES
Worker/WebWorkerServerEndpoint.h
)
find_package(unofficial-skia CONFIG REQUIRED)
serenity_lib(LibWeb web)
target_link_libraries(LibWeb PRIVATE LibCore LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibAudio LibMedia LibWasm LibXML LibIDL LibURL LibTLS unofficial::skia::skia)
find_package(unofficial-skia CONFIG)
if(unofficial-skia_FOUND)
set(SKIA_LIBRARIES unofficial::skia::skia)
else()
find_package(PkgConfig)
pkg_check_modules(SKIA skia=124 REQUIRED)
target_include_directories(LibWeb PRIVATE ${SKIA_INCLUDE_DIRS})
target_link_directories(LibWeb PRIVATE ${SKIA_LIBRARY_DIRS})
endif()
target_link_libraries(LibWeb PRIVATE LibCore LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibAudio LibMedia LibWasm LibXML LibIDL LibURL LibTLS ${SKIA_LIBRARIES})
generate_js_bindings(LibWeb)