CMake: Enable no-as-needed hack for all link languages, not just C++

This commit is contained in:
Andrew Kaster 2024-11-14 16:03:37 -07:00 committed by Andrew Kaster
parent e0adbf3ebb
commit c998f22f9e
Notes: github-actions[bot] 2024-11-15 17:56:50 +00:00

View file

@ -6,8 +6,8 @@ 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(CMAKE_LINK_GROUP_USING_no_as_needed_SUPPORTED TRUE)
set(CMAKE_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()