X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcomponent.cpp;h=6272321b56b702b3b730c9ccca53618efab08078;hb=654de39b62a9a58fd8e1b5a557361d628345788b;hp=b2ac62cc1b2a857a72c64bad3977e671a7f17c0d;hpb=b5ad62c2c4c7eeadd881e3f157bde96e4dd2cc0e;p=builder.git diff --git a/source/component.cpp b/source/component.cpp index b2ac62c..6272321 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -1,19 +1,27 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include #include +#include #include "builder.h" #include "component.h" #include "header.h" #include "install.h" #include "objectfile.h" -#include "package.h" #include "sharedlibrary.h" +#include "sourcepackage.h" #include "staticlibrary.h" #include "target.h" using namespace std; using namespace Msp; -Component::Component(Package &p, Type t, const string &n): +Component::Component(SourcePackage &p, Type t, const string &n): pkg(p), type(t), name(n), @@ -47,6 +55,13 @@ void Component::create_build_info() build_info.add(i->get_package()->get_exported_binfo()); } + if(type==PROGRAM) + { + string strip=pkg.get_config().get_option("strip").value; + if(lexical_cast(strip)) + build_info.ldflags.push_back("-s"); + } + if(modular) { build_info.ldflags.push_back("-rdynamic"); @@ -73,7 +88,7 @@ void Component::create_targets() const PathList files=collect_source_files(); - bool build_exe=(type!=Component::HEADERS); + bool build_exe=(type!=HEADERS); list objs; list inst_tgts; @@ -105,7 +120,7 @@ void Component::create_targets() const { Executable *exe=0; StaticLibrary *slib=0; - if(type==Component::LIBRARY) + if(type==LIBRARY) { exe=new SharedLibrary(builder, *this, objs); slib=new StaticLibrary(builder, *this, objs);