From 92ea7eac95040f2f4fce0bbcd799800e7701118e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 11 Dec 2022 01:17:13 +0200 Subject: [PATCH] When combining build info, keep the highest standard versions --- source/buildinfo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/buildinfo.cpp b/source/buildinfo.cpp index 1cafbd3..af48654 100644 --- a/source/buildinfo.cpp +++ b/source/buildinfo.cpp @@ -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) { -- 2.45.2