1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

Meta: Add a workaround for missing dllimport for skcms API

This should really be fixed by patching the skcms top level header,
but this hack works for now on Windows for linking LibGfx.
This commit is contained in:
Andrew Kaster 2025-02-12 05:21:16 -07:00 committed by Andrew Kaster
parent 21dbfd9114
commit 06ff47749f
Notes: github-actions[bot] 2025-02-13 02:15:12 +00:00
2 changed files with 9 additions and 2 deletions

View file

@ -5,10 +5,13 @@ include(fontconfig)
find_package(unofficial-skia CONFIG)
if(unofficial-skia_FOUND)
set(SKIA_TARGET unofficial::skia::skia)
if (HAS_FONTCONFIG)
if (HAS_FONTCONFIG AND NOT WIN32)
set(CMAKE_LINK_GROUP_USING_no_as_needed_SUPPORTED TRUE CACHE BOOL "Link group using no-as-needed supported")
set(CMAKE_LINK_GROUP_USING_no_as_needed "LINKER:--push-state,--no-as-needed" "LINKER:--pop-state" CACHE STRING "Link group using no-as-needed")
set_property(TARGET unofficial::skia::skia APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<LINK_GROUP:no_as_needed,Fontconfig::Fontconfig>")
elseif(WIN32)
# 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()
else()
find_package(PkgConfig)

View file

@ -279,7 +279,11 @@ set(SKIA_CXX_FLAGS_REL "${VCPKG_COMBINED_CXX_FLAGS_RELEASE}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
foreach (str IN ITEMS SKIA_CXX_FLAGS_DBG SKIA_CXX_FLAGS_REL)
string(APPEND ${str} " -DSKCMS_API=[[gnu::visibility(\\\\\\\"default\\\\\\\")]]")
if (VCPKG_TARGET_IS_WINDOWS)
string(APPEND ${str} " -DSKCMS_API=__declspec(dllexport)")
else()
string(APPEND ${str} " -DSKCMS_API=[[gnu::visibility(\\\\\\\"default\\\\\\\")]]")
endif()
endforeach()
endif()