goat3d

diff goatview/Makefile @ 98:b43d33f3ba69

[goatview] better LLVM/gcc detection [goatview] close_scene might have solved the occasional crashes on opening a second scene
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 May 2014 04:08:11 +0300
parents ae6c5941faac
children
line diff
     1.1 --- a/goatview/Makefile	Mon May 19 06:46:30 2014 +0300
     1.2 +++ b/goatview/Makefile	Wed May 21 04:08:11 2014 +0300
     1.3 @@ -20,6 +20,13 @@
     1.4  qtinc = `pkg-config --cflags Qt5Gui Qt5Core Qt5OpenGL`
     1.5  qtlib = `pkg-config --libs Qt5Gui Qt5Core Qt5OpenGL`
     1.6  
     1.7 +ifeq ($(compiler), clang)
     1.8 +	CXXFLAGS += -stdlib=libc++
     1.9 +	warn += '-Wno-\#warnings'
    1.10 +else
    1.11 +	warn += -Wno-cpp
    1.12 +endif
    1.13 +
    1.14  ifeq ($(shell uname -s), Darwin)
    1.15  	libgl = -framework OpenGL -framework GLUT -lGLEW
    1.16  	libgoat = $(goat_root)/libgoat3d.dylib
    1.17 @@ -32,14 +39,6 @@
    1.18  	libgoat = $(goat_root)/libgoat3d.so.0.1
    1.19  endif
    1.20  
    1.21 -ifeq ($(CC), gcc)
    1.22 -	warn += -Wno-cpp
    1.23 -endif
    1.24 -ifneq ($(shell $(CC) --version | grep LLVM),)
    1.25 -	CXXFLAGS += -stdlib=libc++
    1.26 -	warn += '-Wno-\#warnings'
    1.27 -endif
    1.28 -
    1.29  $(bin): $(obj) $(libgoat)
    1.30  	$(CXX) -o $@ $(obj) $(LDFLAGS)
    1.31  
    1.32 @@ -105,3 +104,12 @@
    1.33  run: $(bin)
    1.34  	./$(bin)
    1.35  endif
    1.36 +
    1.37 +ccver = $(shell $(CC) --version)
    1.38 +ifneq (,$(findstring LLVM,$(ccver)))
    1.39 +	# clang/llvm
    1.40 +	compiler = clang
    1.41 +else
    1.42 +	# other, assume gcc
    1.43 +	compiler = gcc
    1.44 +endif