MINGW-packages/mingw-w64-labplot/001-fix-linking-with-lld.patch
مهدي شينون (Mehdi Chinoune) da9287e3af labplot: update to 2.12.0
2025-04-25 21:03:00 +01:00

23 lines
1.0 KiB
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,7 @@
set (GENERIC_FLAGS "-Wall -Wextra -Wundef -Wpointer-arith -Wunreachable-code -Wunused -Wdeprecated-declarations -fno-omit-frame-pointer -fstack-protector-strong")
#set (GENERIC_GNU_FLAGS "${COMPILER_OPTIMIZATION_FLAG} -Wcast-align -Wswitch-enum -fvisibility=default -pedantic")
set (GENERIC_GNU_FLAGS "${COMPILER_OPTIMIZATION_FLAG} -Wcast-align -Wswitch-enum -fvisibility=default -pedantic -ffunction-sections -fdata-sections -pipe")
-if(NOT APPLE)
+if(NOT (APPLE OR "${CMAKE_C_COMPILER_LINKER_ID}" MATCHES "LLD") )
set (GENERIC_GNU_LINK_FLAGS "-Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined")
endif()
set (GENERIC_C_FLAGS "${GENERIC_FLAGS} -fno-exceptions")
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -566,7 +566,7 @@
if(NOT ICONV_LIBRARIES)
set(ICONV_LIBRARIES "")
endif()
-if(NOT APPLE)
+if(NOT (APPLE OR "${CMAKE_C_COMPILER_LINKER_ID}" MATCHES "LLD") )
set(TURN_OFF_AS_NEEDED "-Wl,--no-as-needed")
set(TURN_ON_AS_NEEDED "-Wl,--as-needed")
endif()