1 # FP_LD_NO_WARN_DUPLICATE_LIBRARIES
2 # ---------------------------------
3 # XCode 15 introduced a new linker which warns on duplicate libraries being
4 # linked. To disable this warning, we pass -Wl,-no_warn_duplicate_libraries as
5 # suggested by Brad King in CMake issue #25297.
7 # This flag isn't necessarily available to other linkers on darwin, so we must
8 # only configure it into the CC linker arguments if valid.
11 # $2 = the name of the linker flags variable when linking with $CC
12 AC_DEFUN([FP_LD_NO_WARN_DUPLICATE_LIBRARIES], [
15 AC_MSG_CHECKING([whether the linker requires -no_warn_duplicate_libraries])
16 echo 'int main(void) {return 0;}' > conftest.c
17 if $CC -o conftest -Wl,-no_warn_duplicate_libraries conftest.c > /dev/null 2>&1
19 $2="$$2 -Wl,-no_warn_duplicate_libraries"
24 rm -f conftest.c conftest.o conftest