From 72997d43349fabcf67d19b3d28ae72fb1b642dfb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 15 May 2014 23:28:16 +0200 Subject: add cxxflags attribute possibility for buildtool. fixes warnings for c-files (-Woverloaded-virtual) (bzr r13341.1.27) --- build-x64.xml | 12 ++++++++---- build.xml | 7 +++++-- buildtool.cpp | 14 +++++++++++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/build-x64.xml b/build-x64.xml index 74d7c2e28..7399b0938 100644 --- a/build-x64.xml +++ b/build-x64.xml @@ -42,7 +42,7 @@ - + @@ -212,7 +212,7 @@ #define ENABLE_SVG_FONTS 1 /* Do we want experimental, unsupported, unguaranteed, etc., LivePathEffects enabled? */ - //#define LPE_ENABLE_TEST_EFFECTS 1 + #define LPE_ENABLE_TEST_EFFECTS 1 /* Do we want experimental, unsupported, unguaranteed, etc., SVG2 features enabled? */ //#define WITH_SVG2 1 @@ -359,8 +359,7 @@ - - -Wall -Wformat -Werror=format-security -Wextra -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch + -Wall -Wformat -Werror=format-security -Wextra -Wpointer-arith -Wcast-align -Wsign-compare -Wswitch -Werror=return-type @@ -374,6 +373,11 @@ -mms-bitfields -fopenmp + + -std=gnu++0x -DCPP11 + -Woverloaded-virtual + + -DVERSION=\"${version}\" -DHAVE_CONFIG_H diff --git a/build.xml b/build.xml index ba07be7da..743151660 100644 --- a/build.xml +++ b/build.xml @@ -356,8 +356,7 @@ - - -Wall -Wformat -Werror=format-security -Wextra -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch + -Wall -Wformat -Werror=format-security -Wextra -Wpointer-arith -Wcast-align -Wsign-compare -Wswitch -Werror=return-type @@ -370,6 +369,10 @@ -mms-bitfields -fopenmp + + + -Woverloaded-virtual + -DVERSION=\"${version}\" -DHAVE_CONFIG_H diff --git a/buildtool.cpp b/buildtool.cpp index 060c352da..a43bb0192 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -6918,7 +6918,9 @@ public: String cxxCommand = parent.eval(cxxCommandOpt, "g++"); String source = parent.eval(sourceOpt, "."); String dest = parent.eval(destOpt, "."); - String flags = parent.eval(flagsOpt, ""); + String ccflags = parent.eval(flagsOpt, ""); + String cxxflags = parent.eval(cxxflagsOpt, ""); + String flags = ccflags; String defines = parent.eval(definesOpt, ""); String includes = parent.eval(includesOpt, ""); bool continueOnError = parent.evalBool(continueOnErrorOpt, true); @@ -7027,7 +7029,10 @@ public: String command = ccCommand; if (sfx == "cpp" || sfx == "cxx" || sfx == "c++" || sfx == "cc" || sfx == "CC") + { command = cxxCommand; + flags += " " + cxxflags; + } //## Make paths String destPath = dest; @@ -7203,6 +7208,12 @@ public: return false; flagsOpt = strip(flagsOpt); } + else if (tagName == "cxxflags") + { + if (!parent.getValue(child, cxxflagsOpt)) + return false; + cxxflagsOpt = strip(cxxflagsOpt); + } else if (tagName == "includes") { if (!parent.getValue(child, includesOpt)) @@ -7239,6 +7250,7 @@ protected: String sourceOpt; String destOpt; String flagsOpt; + String cxxflagsOpt; String definesOpt; String includesOpt; String continueOnErrorOpt; -- cgit v1.2.3