X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildinfo.cpp;h=c02d115fd1b252e409191834a9ca45730efeaaf1;hb=1dbeace0c44127bee08a3a8b231f4c8dcf707b2c;hp=4c4029ea24f757d97ccc897c4ee73dc124f9349b;hpb=abb2336c34b94abc0508a00f07afdf85d7c78951;p=builder.git diff --git a/source/buildinfo.cpp b/source/buildinfo.cpp index 4c4029e..c02d115 100644 --- a/source/buildinfo.cpp +++ b/source/buildinfo.cpp @@ -31,7 +31,9 @@ BuildInfo::BuildInfo(): threads(false), debug(false), optimize(0), - strip(false) + strip(false), + warning_level(0), + fatal_warnings(false) { } void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level) @@ -44,7 +46,6 @@ void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level) libpath.insert(libpath.end(), bi.libpath.begin(), bi.libpath.end()); libs.insert(libs.end(), bi.libs.begin(), bi.libs.end()); } - warnings.insert(warnings.end(), bi.warnings.begin(), bi.warnings.end()); threads = bi.threads; if(level==LOCAL) { @@ -52,37 +53,13 @@ void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level) debug = bi.debug; optimize = bi.optimize; strip = bi.strip; + warning_level = bi.warning_level; + fatal_warnings = bi.fatal_warnings; } - unique(); -} - -void BuildInfo::unique() -{ - ::unique(incpath); - ::unique(libpath); - ::unique(libs); - - for(WordList::iterator i=warnings.begin(); i!=warnings.end(); ++i) - { - bool flag = i->compare(0, 3, "no-"); - - string warn = (flag ? *i : i->substr(3)); - string no_warn = "no-"+warn; - - for(WordList::iterator j=i; j!=warnings.end();) - { - if(j!=i && (*j==warn || *j==no_warn)) - { - flag = (*j==warn); - j = warnings.erase(j); - } - else - ++j; - } - - *i = (flag ? warn : no_warn); - } + unique(incpath); + unique(libpath); + unique(libs); } @@ -98,7 +75,8 @@ BuildInfo::Loader::Loader(BuildInfo &bi): add("optimize", &BuildInfo::optimize); add("strip", &BuildInfo::strip); add("threads", &BuildInfo::threads); - add("warning", &Loader::warning); + add("warning_level", &BuildInfo::warning_level); + add("fatal_warnings", &BuildInfo::fatal_warnings); } void BuildInfo::Loader::incpath(const string &s) @@ -121,13 +99,8 @@ void BuildInfo::Loader::library(const string &s) obj.libs.push_back(s); } -void BuildInfo::Loader::warning(const string &s) -{ - obj.warnings.push_back(s); -} - -void operator>>(LexicalConverter &conv, BuildInfo::LibraryMode &libmode) +void operator>>(const LexicalConverter &conv, BuildInfo::LibraryMode &libmode) { if(conv.get()=="FORCE_STATIC") libmode = BuildInfo::FORCE_STATIC;