From 3226aee6668ce0ce647c5591d93e5de289fc67d7 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 7 Nov 2024 12:44:40 -0700 Subject: [PATCH] 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. --- Meta/CMake/skia.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Meta/CMake/skia.cmake b/Meta/CMake/skia.cmake index 0506d3fa77f..6b3c172d610 100644 --- a/Meta/CMake/skia.cmake +++ b/Meta/CMake/skia.cmake @@ -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 "$") + endif() else() find_package(PkgConfig)