Make it better

This commit is contained in:
Alexey Milovidov 2024-10-06 02:09:30 +08:00
parent 9439004c4e
commit 38fb032594
2 changed files with 2 additions and 2 deletions

View File

@ -182,8 +182,6 @@ if (OS_DARWIN)
set(WHOLE_ARCHIVE -force_load) set(WHOLE_ARCHIVE -force_load)
# The `-noall_load` flag is the default and now obsolete. # 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. 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 () else ()
set(WHOLE_ARCHIVE --whole-archive) set(WHOLE_ARCHIVE --whole-archive)
set(NO_WHOLE_ARCHIVE --no-whole-archive) set(NO_WHOLE_ARCHIVE --no-whole-archive)

View File

@ -48,6 +48,8 @@ if (NOT LINKER_NAME)
find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "ld.lld") find_program (LLD_PATH NAMES "ld.lld-${COMPILER_VERSION_MAJOR}" "ld.lld")
elseif (OS_DARWIN) elseif (OS_DARWIN)
find_program (LLD_PATH NAMES "ld") 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 () endif ()
if (LLD_PATH) if (LLD_PATH)
if (OS_LINUX OR OS_DARWIN) if (OS_LINUX OR OS_DARWIN)