From: ishmal Date: Fri, 25 Apr 2008 17:23:55 +0000 (+0000) Subject: Add a "continueOnError" flag to TaskCC. If there is an error in one of the files... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=65dbacd23ff259ab02b3226e9c3ee8833c1e2392;p=inkscape.git Add a "continueOnError" flag to TaskCC. If there is an error in one of the files, it will continue with other files, but the final result will still be an error. --- diff --git a/buildtool.cpp b/buildtool.cpp index 21a7a4aef..2556cd837 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -38,7 +38,7 @@ * */ -#define BUILDTOOL_VERSION "BuildTool v0.8.1, 2007-2008 Bob Jamison" +#define BUILDTOOL_VERSION "BuildTool v0.8.2, 2007-2008 Bob Jamison" #include #include @@ -6161,14 +6161,16 @@ public: TaskCC(MakeBase &par) : Task(par) { - type = TASK_CC; name = "cc"; - ccCommand = "gcc"; - cxxCommand = "g++"; - source = "."; - dest = "."; - flags = ""; - defines = ""; - includes = ""; + type = TASK_CC; + name = "cc"; + ccCommand = "gcc"; + cxxCommand = "g++"; + source = "."; + dest = "."; + flags = ""; + defines = ""; + includes = ""; + continueOnError = false; fileSet.clear(); excludeInc.clear(); } @@ -6249,6 +6251,11 @@ public: dname.append(dirName); incs.append(parent.resolve(dname)); } + + /** + * Compile each of the C files that need it + */ + bool errorOccurred = false; std::vector cfiles; for (viter=deps.begin() ; viter!=deps.end() ; viter++) { @@ -6384,9 +6391,10 @@ public: if (!ret) { error("problem compiling: %s", errString.c_str()); - return false; + errorOccurred = true; } - + if (errorOccurred || !continueOnError) + break; } if (f) @@ -6394,7 +6402,7 @@ public: fclose(f); } - return true; + return errorOccurred; } virtual bool parse(Element *elem) @@ -6412,6 +6420,10 @@ public: if (!parent.getAttribute(elem, "destdir", s)) return false; if (s.size()>0) dest = s; + if (!parent.getAttribute(elem, "continueOnError", s)) + return false; + if (s=="true" || s=="yes") + continueOnError = true; std::vector children = elem->getChildren(); for (unsigned int i=0 ; i