From 5260f20fcfd1e31ef9acae60c647a22d630dcd73 Mon Sep 17 00:00:00 2001 From: Coelacanthus Date: Sun, 15 Dec 2024 00:45:55 +0800 Subject: [PATCH] fix: only apply --export-all-symbol on Windows 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 --- euicc/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/euicc/CMakeLists.txt b/euicc/CMakeLists.txt index ac6018b..f16ba1f 100644 --- a/euicc/CMakeLists.txt +++ b/euicc/CMakeLists.txt @@ -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)