[LLVMdev] problems building googletest for 2.5
Mike Stump
mrs at apple.com
Wed Feb 4 21:26:28 PST 2009
On Feb 4, 2009, at 9:10 PM, Tanya Lattner wrote:
> Ideally, configure should detect what version of gcc you have and
> either use those CPP FLAGS or not (it will output warnings with
> 3.X). Or, we just disable building Google Test by default.
> Can anyone help with this?
Here is a Makefile fragment that will dynamically test gcc and add
flags, if the flag is supported. I'll leave it up to others to
consider and/or integrate it and consider if /dev/null is portable
enough.
FLAGS := $(shell gcc -Wall -fsyntax-only -xc /dev/null 2>/dev/null &&
echo -Wall)
CFLAGS := $(shell gcc -Wallme -fsyntax-only -xc /dev/null 2>/dev/null
&& echo -Wallme)
all:
@echo flags are $(FLAGS)
@echo flags are $(CFLAGS)
The down side, these execute every time the fragment is read. If
limited to just a few directories, it should be fine, Makefile.common
would hurt.
More information about the llvm-dev
mailing list