X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuildinfo.cpp;h=e2df34c06e3ec91cb56500f97c3bed1b53b23d02;hb=HEAD;hp=2b4876fbda871c38d6281a49497539f2b7d54236;hpb=445edbc3c42bbd7880cc414cf153ddfd196bfc1c;p=builder.git diff --git a/source/buildinfo.cpp b/source/buildinfo.cpp deleted file mode 100644 index 2b4876f..0000000 --- a/source/buildinfo.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "buildinfo.h" - -using namespace Msp; - -/** -Adds another BuildInfo to the end of this one. -*/ -void BuildInfo::add(const BuildInfo &bi) -{ - cflags.insert(cflags.end(), bi.cflags.begin(), bi.cflags.end()); - defines.insert(defines.end(), bi.defines.begin(), bi.defines.end()); - incpath.insert(incpath.end(), bi.incpath.begin(), bi.incpath.end()); - ldflags.insert(ldflags.end(), bi.ldflags.begin(), bi.ldflags.end()); - libpath.insert(libpath.end(), bi.libpath.begin(), bi.libpath.end()); - libs.insert(libs.end(), bi.libs.begin(), bi.libs.end()); -} - -/** -Makes sure there are no duplicate entries in the lists. -*/ -void BuildInfo::unique() -{ - unique(cflags); - unique(defines); - unique(incpath); - unique(ldflags); - unique(libpath); - unique(libs); -} - -/** -Removes any duplicate entries from a list, leaving only the first one. The -order of other elements is preserved. O(n²) efficiency. -*/ -void BuildInfo::unique(StringList &l) -{ - StringList l2; - for(StringList::iterator i=l.begin(); i!=l.end(); ++i) - if(find(l2.begin(), l2.end(), *i)==l2.end()) - l2.push_back(*i); - swap(l, l2); -} - -BuildInfo::Loader::Loader(BuildInfo &bi): - binfo(bi) -{ - add("cflag", &Loader::cflag); - add("incpath", &Loader::incpath); - add("define", &Loader::define); - add("ldflag", &Loader::ldflag); - add("libpath", &Loader::libpath); - add("library", &Loader::library); -} - -