Make detection of clang++ compiler more robust (#915)

* Make detection of clang++ compiler more robust
* Updated makefile generator
This commit is contained in:
Ivan Ryabov 2017-06-16 20:56:29 +10:00 committed by Matthias Krüger
parent f86d8244fa
commit 170cfc24a2
2 changed files with 6 additions and 6 deletions

View File

@ -76,16 +76,16 @@ ifndef CXX
CXX=g++ CXX=g++
endif endif
ifeq ($(CXX), clang++) ifeq (clang++, $(findstring clang++,$(CXX)))
CPPCHK_GLIBCXX_DEBUG= CPPCHK_GLIBCXX_DEBUG=
endif endif
ifndef CXXFLAGS ifndef CXXFLAGS
CXXFLAGS=-include lib/cxx11emu.h -pedantic -Wall -Wextra -Wabi -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wshadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar $(CPPCHK_GLIBCXX_DEBUG) -g CXXFLAGS=-include lib/cxx11emu.h -pedantic -Wall -Wextra -Wabi -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wno-long-long -Wpacked -Wredundant-decls -Wshadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-sign-compare -Wno-multichar $(CPPCHK_GLIBCXX_DEBUG) -g
endif endif
ifeq ($(CXX), g++) ifeq (g++, $(findstring g++,$(CXX)))
override CXXFLAGS += -std=c++0x override CXXFLAGS += -std=c++0x
else ifeq ($(CXX), clang++) else ifeq (clang++, $(findstring clang++,$(CXX)))
override CXXFLAGS += -std=c++0x override CXXFLAGS += -std=c++0x
else ifeq ($(CXX), c++) else ifeq ($(CXX), c++)
ifeq ($(shell uname -s), Darwin) ifeq ($(shell uname -s), Darwin)

View File

@ -275,7 +275,7 @@ int main(int argc, char **argv)
// skip "-D_GLIBCXX_DEBUG" if clang, since it breaks the build // skip "-D_GLIBCXX_DEBUG" if clang, since it breaks the build
makeConditionalVariable(fout, "CXX", "g++"); makeConditionalVariable(fout, "CXX", "g++");
fout << "ifeq ($(CXX), clang++)\n" fout << "ifeq (clang++, $(findstring clang++,$(CXX)))\n"
<< " CPPCHK_GLIBCXX_DEBUG=\n" << " CPPCHK_GLIBCXX_DEBUG=\n"
<< "endif\n"; << "endif\n";
@ -315,9 +315,9 @@ int main(int argc, char **argv)
"-g"); "-g");
} }
fout << "ifeq ($(CXX), g++)\n" fout << "ifeq (g++, $(findstring g++,$(CXX)))\n"
<< " override CXXFLAGS += -std=c++0x\n" << " override CXXFLAGS += -std=c++0x\n"
<< "else ifeq ($(CXX), clang++)\n" << "else ifeq (clang++, $(findstring clang++,$(CXX)))\n"
<< " override CXXFLAGS += -std=c++0x\n" << " override CXXFLAGS += -std=c++0x\n"
<< "else ifeq ($(CXX), c++)\n" << "else ifeq ($(CXX), c++)\n"
<< " ifeq ($(shell uname -s), Darwin)\n" << " ifeq ($(shell uname -s), Darwin)\n"