mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00: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:
committed by
Andrew Kaster
parent
21dbfd9114
commit
06ff47749f
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
string(APPEND ${str} " -DSKCMS_API=__declspec(dllexport)")
|
||||
else()
|
||||
string(APPEND ${str} " -DSKCMS_API=[[gnu::visibility(\\\\\\\"default\\\\\\\")]]")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user