From: ishmal Date: Fri, 4 Apr 2008 15:42:56 +0000 (+0000) Subject: Add an filelist tag to to avoid float.h in extension/param X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4c48b4a049e91795eb8eb21598dc59a081839d89;p=inkscape.git Add an filelist tag to to avoid float.h in extension/param --- diff --git a/build.xml b/build.xml index 1014fc36e..432fcdd38 100644 --- a/build.xml +++ b/build.xml @@ -271,6 +271,9 @@ + + + -Wall -Wformat-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -O2 diff --git a/buildtool.cpp b/buildtool.cpp index f912ebdea..edf738269 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -38,7 +38,7 @@ * */ -#define BUILDTOOL_VERSION "BuildTool v0.7.7, 2007-2008 Bob Jamison" +#define BUILDTOOL_VERSION "BuildTool v0.8, 2007-2008 Bob Jamison" #include #include @@ -2862,6 +2862,99 @@ private: }; +//######################################################################## +//# F I L E L I S T +//######################################################################## +/** + * This is a simpler, explicitly-named list of files + */ +class FileList +{ +public: + + /** + * + */ + FileList() + {} + + /** + * + */ + FileList(const FileList &other) + { assign(other); } + + /** + * + */ + FileList &operator=(const FileList &other) + { assign(other); return *this; } + + /** + * + */ + virtual ~FileList() + {} + + /** + * + */ + String getDirectory() + { return directory; } + + /** + * + */ + void setDirectory(const String &val) + { directory = val; } + + /** + * + */ + void setFiles(const std::vector &val) + { files = val; } + + /** + * + */ + std::vector getFiles() + { return files; } + + /** + * + */ + unsigned int size() + { return files.size(); } + + /** + * + */ + String operator[](int index) + { return files[index]; } + + /** + * + */ + void clear() + { + directory = ""; + files.clear(); + } + + +private: + + void assign(const FileList &other) + { + directory = other.directory; + files = other.files; + } + + String directory; + std::vector files; +}; + + //######################################################################## @@ -3071,6 +3164,12 @@ protected: bool parseFileSet(Element *elem, MakeBase &propRef, FileSet &fileSet); + /** + * Parse a entry + */ + bool parseFileList(Element *elem, + MakeBase &propRef, + FileList &fileList); /** * Return this object's property list @@ -4075,6 +4174,49 @@ bool MakeBase::parseFileSet(Element *elem, return true; } +/** + * Parse a entry. This is far simpler than FileSet, + * since no directory scanning is needed. The file names are listed + * explicitly. + */ +bool MakeBase::parseFileList(Element *elem, + MakeBase &propRef, + FileList &fileList) +{ + std::vector fnames; + //Look for child tags, namely "file" + std::vector children = elem->getChildren(); + for (unsigned int i=0 ; igetName(); + if (tagName == "file") + { + String fname = child->getAttribute("name"); + if (fname.size()==0) + { + error(" element requires name="" attribute"); + return false; + } + fnames.push_back(fname); + } + else + { + error("tag <%s> not allowed in ", tagName.c_str()); + return false; + } + } + + String dir; + //Get the base directory for reading file names + if (!propRef.getAttribute(elem, "dir", dir)) + return false; + fileList.setDirectory(dir); + fileList.setFiles(fnames); + + return true; +} + /** @@ -6011,16 +6153,22 @@ public: defines = ""; includes = ""; fileSet.clear(); + excludeInc.clear(); } virtual ~TaskCC() {} - virtual bool needsCompiling(const FileRec &depRec, - const String &src, const String &dest) + virtual bool isExcludedInc(const String &dirname) { + for (unsigned int i=0 ; i::iterator setIter; for (setIter=paths.begin() ; setIter!=paths.end() ; setIter++) { + String dirName = *setIter; + //check excludeInc to see if we dont want to include this dir + if (isExcludedInc(dirName)) + continue; incs.append(" -I"); String dname; if (source.size()>0) @@ -6077,7 +6229,7 @@ public: dname.append(source); dname.append("/"); } - dname.append(*setIter); + dname.append(dirName); incs.append(parent.resolve(dname)); } std::vector cfiles; @@ -6273,6 +6425,11 @@ public: return false; source = fileSet.getDirectory(); } + else if (tagName == "excludeinc") + { + if (!parseFileList(child, parent, excludeInc)) + return false; + } } return true; @@ -6280,14 +6437,16 @@ public: protected: - String ccCommand; - String cxxCommand; - String source; - String dest; - String flags; - String defines; - String includes; - FileSet fileSet; + String ccCommand; + String cxxCommand; + String source; + String dest; + String flags; + String lastflags; + String defines; + String includes; + FileSet fileSet; + FileList excludeInc; };