Open dmacks opened 3 years ago
That's also why I see the following during compiling in the src subdir:
/bin/sh ../libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I. -I.. -I../include -I.. -I../libcnary/include -I/sw/include -Wall -Wextra -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -Wno-strict-aliasing -fvisibility=hidden -g -O2 -MT plist.lo -MD -MP -MF .deps/plist.Tpo -c -o plist.lo plist.c
[...]
/bin/sh ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I.. -I../libcnary/include -I/sw/include -g -O2 -MT Node.lo -MD -MP -MF .deps/Node.Tpo -c -o Node.lo Node.cpp
Notice all the -W flags are used only for C not for C++ because again they are being passed as AM_CFLAGS ("C language") not AM_CPPFLAGS ("CPP stage" all languages).
On OS X 10.13 with a previous version (1.x) of libplist installed:
The problem is that the older plist.h in the systemwide directory is being included rather than the one in the source directory because -I../include is after -I/sw/include. If I get rid of -Werror, I see a weird subsequent flag also:
Why is -I going to the linker?
All of this is because tools/Makefile.am (and some other Makefile.am also) are passing local -I via AM_CFLAGS instead of AM_CPPFLAGS. "CFLAGS" is the "C compiler" (.c→.o and linking), whereas "CPPFLAGS" is "the →.o stage" (for both C and C++). It's confusing because