From 50be4619cca4bb44e5abf8759720c255ef6d3b45 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 9 Jun 2012 01:58:04 +0300 Subject: [PATCH] Make BuildInfo uniquify things implicitly after update --- source/buildinfo.cpp | 2 ++ source/buildinfo.h | 1 + source/component.cpp | 2 -- source/sourcepackage.cpp | 4 ---- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/buildinfo.cpp b/source/buildinfo.cpp index 463357d..ec81567 100644 --- a/source/buildinfo.cpp +++ b/source/buildinfo.cpp @@ -48,6 +48,8 @@ void BuildInfo::update_from(const BuildInfo &bi, UpdateLevel level) optimize = bi.optimize; strip = bi.strip; } + + unique(); } void BuildInfo::unique() diff --git a/source/buildinfo.h b/source/buildinfo.h index 18f33a0..297efff 100644 --- a/source/buildinfo.h +++ b/source/buildinfo.h @@ -52,6 +52,7 @@ public: The update level determines what information is updated. */ void update_from(const BuildInfo &, UpdateLevel = LOCAL); +private: /** Makes sure there are no duplicate entries in the lists. For warnings, contradicting flags are eliminated and the last one stays in effect. */ void unique(); diff --git a/source/component.cpp b/source/component.cpp index cc4796c..c4908c9 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -77,8 +77,6 @@ void Component::create_build_info() if(type==PROGRAM) build_info.strip = lexical_cast(pkg.get_config().get_option("strip").value); - - build_info.unique(); } void Component::create_targets() const diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 60276da..7d0ed1d 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -218,16 +218,12 @@ void SourcePackage::create_build_info() if(i->eval()) build_info.update_from(i->get_build_info()); - build_info.unique(); - for(list::iterator i=components.begin(); i!=components.end(); ++i) { i->create_build_info(); if(i->get_type()==Component::LIBRARY) export_binfo.libs.push_back(i->get_name()); } - - export_binfo.unique(); } -- 2.43.0