]> git.tdb.fi Git - builder.git/commitdiff
When combining build info, keep the highest standard versions
authorMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2022 23:17:13 +0000 (01:17 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 10 Dec 2022 23:17:37 +0000 (01:17 +0200)
source/buildinfo.cpp

index 1cafbd3b866344d2665181393b7e1fa0855ea197..af4865498c5fd61c2105d987f783ff23d21d5466 100644 (file)
@@ -51,8 +51,20 @@ void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level)
                defines[i->first] = i->second;
        incpath.insert(incpath.begin(), bi.incpath.begin(), bi.incpath.end());
        threads = bi.threads;
+
        for(StandardMap::const_iterator i=bi.standards.begin(); i!=bi.standards.end(); ++i)
-               standards[i->first] = i->second;
+       {
+               StandardMap::iterator j = standards.find(i->first);
+               if(j==standards.end())
+                       standards.insert(*i);
+               else if(i->second.type!=j->second.type || i->second.year!=j->second.year)
+               {
+                       if(!i->second.type.compare(0, 3, "gnu"))
+                               j->second.type = i->second.type;
+                       if(i->second.year>j->second.year)
+                               j->second.year = i->second.year;
+               }
+       }
 
        if(level!=CHAINED)
        {