diff --git a/Makefile b/Makefile index 5117c0c8d..dad185d30 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,13 @@ ifeq ($(CXX), clang++) CPPCHK_GLIBCXX_DEBUG= endif ifndef CXXFLAGS - CXXFLAGS=-std=c++0x -include lib/cxx11emu.h -pedantic -Wall -Wextra -Wabi -Wcast-qual -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wshadow -Wsign-promo -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare $(CPPCHK_GLIBCXX_DEBUG) -g + CXXFLAGS=-include lib/cxx11emu.h -pedantic -Wall -Wextra -Wabi -Wcast-qual -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wshadow -Wsign-promo -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare $(CPPCHK_GLIBCXX_DEBUG) -g +endif + +ifeq ($(CXX), g++) + override CXXFLAGS += -std=c++0x +else ifeq ($(CXX), clang++) + override CXXFLAGS += -std=c++0x endif ifeq ($(HAVE_RULES),yes) diff --git a/tools/dmake.cpp b/tools/dmake.cpp index 20773f439..ca112f20b 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -328,7 +328,6 @@ int main(int argc, char **argv) // -Wsign-conversion : too many warnings // -Wunreachable-code : some GCC versions report lots of warnings makeConditionalVariable(fout, "CXXFLAGS", - "-std=c++0x " "-include lib/cxx11emu.h " "-pedantic " "-Wall " @@ -356,6 +355,13 @@ int main(int argc, char **argv) "-g"); } + fout << "ifeq ($(CXX), g++)\n" + << " override CXXFLAGS += -std=c++0x\n" + << "else ifeq ($(CXX), clang++)\n" + << " override CXXFLAGS += -std=c++0x\n" + << "endif\n" + << "\n"; + fout << "ifeq ($(HAVE_RULES),yes)\n" << " CXXFLAGS += -DHAVE_RULES -DTIXML_USE_STL $(shell pcre-config --cflags)\n" << " ifdef LIBS\n"