Avoid warnings from ranlib on macOS
This fixes these warnings emitted when building a static library on macOS as reported in https://github.com/c-ares/c-ares/issues/446:
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_android.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_getenv.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_platform.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_strcasecmp.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_writev.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(windows_port.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_android.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_getenv.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_platform.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_strcasecmp.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(ares_writev.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: auxil/c-ares/lib/libcares.a(windows_port.c.o) has no symbols
Is there something holding this from getting merged?
Is this actually causing an issue on MacOS? Lots of platforms have these warnings with c-ares because c-ares compiles every file on every platform regardless of if it is used. Solving it on one platform leaves the rest untouched.
Is this actually causing an issue on MacOS?
Nothing beyond the annoying warnings.
Lots of platforms have these warnings with c-ares because c-ares compiles every file on every platform regardless of if it is used.
I didn't dig too far into the CMake configuration for c-ares, but a better fix would be to not include files that aren't needed for a platform. I can rework this PR to do that instead if you want me to go that way.
I agree, however @bagder set a requirement that all build systems must use the same file for list of sources for all the various build systems we support (nmake makefiles, mingw makefiles, autotools, cmake ...). So you'll notice the weird CMake thing to read in Makefile.inc ... maybe we could add more variables to that file for per-platform files, but I'm not really sure if its worthwhile.