From 38fb03259454fe4cf20b405b6bf1b5b771f4bf67 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 6 Oct 2024 02:09:30 +0800 Subject: [PATCH] Make it better --- CMakeLists.txt | 2 -- cmake/tools.cmake | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca968da453f..644ebf3a3dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,8 +182,6 @@ if (OS_DARWIN) set(WHOLE_ARCHIVE -force_load) # The `-noall_load` flag is the default and now obsolete. set(NO_WHOLE_ARCHIVE "-undefined,error") # Effectively, a no-op. Here to avoid empty "-Wl, " sequence to be generated in the command line. - # Duplicate libraries passed to the linker is not a problem. - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_warn_duplicate_libraries") else () set(WHOLE_ARCHIVE --whole-archive) set(NO_WHOLE_ARCHIVE --no-whole-archive) diff --git a/cmake/tools.cmake b/cmake/tools.cmake index 5c7da54b779..d95f1fbb29b 100644 --- a/cmake/tools.cmake +++ b/cmake/tools.cmake @@ -48,6 +48,8 @@ if (NOT LINKER_NAME) find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "ld.lld") elseif (OS_DARWIN) find_program (LLD_PATH NAMES "ld") + # Duplicate libraries passed to the linker is not a problem. + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_warn_duplicate_libraries") endif () if (LLD_PATH) if (OS_LINUX OR OS_DARWIN)