Make cxxstd an argument to Makefile
This determines the used C++ standard. If you do not want to use a specific C++ standard, use cxxstd=any. The default is set to c++11. The "define" PUGIXML_NO_CXX11 is removed from the Makefile since it is not used in the code anyways.
This commit is contained in:
parent
fb647f69a2
commit
6bbbdb7d7e
9
Makefile
9
Makefile
@ -3,8 +3,10 @@ MAKEFLAGS+=-r
|
|||||||
|
|
||||||
config=debug
|
config=debug
|
||||||
defines=standard
|
defines=standard
|
||||||
|
cxxstd=c++11
|
||||||
|
# set cxxstd=any to disable use of -std=...
|
||||||
|
|
||||||
BUILD=build/make-$(CXX)-$(config)-$(defines)
|
BUILD=build/make-$(CXX)-$(config)-$(defines)-$(cxxstd)
|
||||||
|
|
||||||
SOURCES=src/pugixml.cpp $(filter-out tests/fuzz_%,$(wildcard tests/*.cpp))
|
SOURCES=src/pugixml.cpp $(filter-out tests/fuzz_%,$(wildcard tests/*.cpp))
|
||||||
EXECUTABLE=$(BUILD)/test
|
EXECUTABLE=$(BUILD)/test
|
||||||
@ -47,9 +49,8 @@ ifneq ($(findstring PUGIXML_NO_EXCEPTIONS,$(defines)),)
|
|||||||
CXXFLAGS+=-fno-exceptions
|
CXXFLAGS+=-fno-exceptions
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(findstring PUGIXML_NO_CXX11,$(defines)),)
|
ifneq ($(cxxstd),any)
|
||||||
# Can't use std=c++11 since Travis-CI has gcc 4.6.3
|
CXXFLAGS+=-std=$(cxxstd)
|
||||||
CXXFLAGS+=-std=c++0x
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJECTS=$(SOURCES:%=$(BUILD)/%.o)
|
OBJECTS=$(SOURCES:%=$(BUILD)/%.o)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user