]> git.tdb.fi Git - builder.git/blobdiff - source/buildinfo.cpp
Generate export definitions with dlltool
[builder.git] / source / buildinfo.cpp
index 4c4029ea24f757d97ccc897c4ee73dc124f9349b..c02d115fd1b252e409191834a9ca45730efeaaf1 100644 (file)
@@ -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;