fix: only apply --export-all-symbol on Windows (#176)

It's meaningless for other platforms. And ld.gold doesn't support so if
LTO was enabled we will get invalid arguments.

address #152

Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
This commit is contained in:
Coelacanthus 2024-12-15 10:56:02 +08:00 committed by GitHub
parent da3d2a8e7a
commit b21406da8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,10 @@ if(LPAC_DYNAMIC_LIBEUICC)
endif()
endforeach()
set_target_properties(euicc PROPERTIES PUBLIC_HEADER "${ALL_HEADERS}")
set_target_properties(euicc PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
# Only useful on Windows, and will lead to invalid arguments on ld.gold.
if(WIN32)
set_target_properties(euicc PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
endif()
# Install a pkg-config file
configure_file(libeuicc.pc.in libeuicc.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libeuicc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)