dmake: use -std=c++11 even if CXXFLAGS is redefined

This commit is contained in:
Daniel Marjamäki 2014-01-12 13:47:53 +01:00
parent 86763b401c
commit 50c8075b15
1 changed files with 6 additions and 7 deletions

View File

@ -82,7 +82,7 @@ static void compilefiles(std::ostream &fout, const std::vector<std::string> &fil
getDeps(files[i], depfiles);
for (unsigned int dep = 0; dep < depfiles.size(); ++dep)
fout << " " << depfiles[dep];
fout << "\n\t$(CXX) " << args << " $(CPPFLAGS) $(CFG) $(CXXFLAGS) -c -o " << objfile(files[i]) << " " << builddir(files[i]) << "\n\n";
fout << "\n\t$(CXX) " << args << " $(CPPFLAGS) $(CFG) $(CXXFLAGS) -std=c++11 -c -o " << objfile(files[i]) << " " << builddir(files[i]) << "\n\n";
}
}
@ -290,7 +290,7 @@ int main(int argc, char **argv)
// Makefile settings..
if (release) {
makeConditionalVariable(fout, "CXXFLAGS", "-O2 -DNDEBUG -Wall -std=c++11");
makeConditionalVariable(fout, "CXXFLAGS", "-O2 -DNDEBUG -Wall");
} else {
// TODO: add more compiler warnings.
// -Wlogical-op : doesn't work on older GCC
@ -316,7 +316,6 @@ int main(int argc, char **argv)
// "-Wsign-conversion "
"-Wsign-promo "
// "-Wunreachable-code "
"-std=c++11 "
"$(CPPCHK_GLIBCXX_DEBUG) "
"-g");
}
@ -360,18 +359,18 @@ int main(int argc, char **argv)
fout << "\n###### Targets\n\n";
fout << "cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++11 -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n";
fout << "all:\tcppcheck testrunner\n\n";
fout << "testrunner: $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/filelister.o cli/pathmatch.o\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++11 -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n";
fout << "test:\tall\n";
fout << "\t./testrunner\n\n";
fout << "check:\tall\n";
fout << "\t./testrunner -g -q\n\n";
fout << "dmake:\ttools/dmake.cpp\n";
fout << "\t$(CXX) -o dmake tools/dmake.cpp cli/filelister.cpp lib/path.cpp -Ilib $(LDFLAGS)\n\n";
fout << "\t$(CXX) -std=c++11 -o dmake tools/dmake.cpp cli/filelister.cpp lib/path.cpp -Ilib $(LDFLAGS)\n\n";
fout << "reduce:\ttools/reduce.cpp\n";
fout << "\t$(CXX) -g -o reduce tools/reduce.cpp -Ilib -Iexternals/tinyxml lib/*.cpp externals/tinyxml/tinyxml2.cpp\n\n";
fout << "\t$(CXX) -std=c++11 -g -o reduce tools/reduce.cpp -Ilib -Iexternals/tinyxml lib/*.cpp externals/tinyxml/tinyxml2.cpp\n\n";
fout << "clean:\n";
fout << "\trm -f build/*.o lib/*.o cli/*.o test/*.o externals/tinyxml/*.o testrunner reduce cppcheck cppcheck.1\n\n";
fout << "man:\tman/cppcheck.1\n\n";