CMake: Force-load fontconfig into dependencies of skia

The dynamic shared lib build of skia doesn't seem to actually express
any dependencies in its DT_NEEDED section, so we need to force-load
fontconfig into the dependencies of the skia target to avoid runtime
linker errors.
This commit is contained in:
Andrew Kaster 2024-11-07 12:44:40 -07:00 committed by Andrew Kaster
parent e65eff22e8
commit 3226aee666
Notes: github-actions[bot] 2024-11-08 18:18:16 +00:00

View file

@ -1,8 +1,15 @@
include_guard()
include(fontconfig)
find_package(unofficial-skia CONFIG)
if(unofficial-skia_FOUND)
set(SKIA_TARGET unofficial::skia::skia)
if (HAS_FONTCONFIG)
set(CMAKE_CXX_LINK_GROUP_USING_no_as_needed_SUPPORTED TRUE)
set(CMAKE_CXX_LINK_GROUP_USING_no_as_needed "LINKER:--push-state,--no-as-needed" "LINKER:--pop-state")
set_property(TARGET unofficial::skia::skia APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<LINK_GROUP:no_as_needed,Fontconfig::Fontconfig>")
endif()
else()
find_package(PkgConfig)