From 4b384a3593c09e2503bafe8037aa4992610cba5f Mon Sep 17 00:00:00 2001 From: Olekoop Date: Tue, 10 Jun 2025 19:09:39 +0200 Subject: [PATCH] Meta: Add a workaround when compiling for Android We shouldn't do any of this but it's necessary in order to link it properly. --- Meta/CMake/skia.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Meta/CMake/skia.cmake b/Meta/CMake/skia.cmake index 11b9e534150..a765ff53c04 100644 --- a/Meta/CMake/skia.cmake +++ b/Meta/CMake/skia.cmake @@ -13,6 +13,17 @@ if(unofficial-skia_FOUND) # FIXME: Submit a proper patch to vcpkg and skia to the SKCMS header file to set this in a cross-platform way. set_property(TARGET unofficial::skia::skia APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "SKCMS_API=__declspec(dllimport)") endif() + if (ANDROID) + # FIXME: Submit a proper patch to vcpkg in order not to bring host's libc++ when compiling for Android + get_target_property(link_libs unofficial::skia::skia INTERFACE_LINK_LIBRARIES) + set(filtered_libs) + foreach(lib ${link_libs}) + if (NOT lib MATCHES "lib/libc\\+\\+.so$") + list(APPEND filtered_libs ${lib}) + endif() + endforeach() + set_property(TARGET unofficial::skia::skia PROPERTY INTERFACE_LINK_LIBRARIES ${filtered_libs}) + endif() else() find_package(PkgConfig)