]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Add Symlink target and associated action
[builder.git] / source / component.cpp
index 5c1d9f6b6b6a9d3ab35d83cc1258a4921557b6d3..cf4234607e978d1f6399a2732adaded39496602d 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-2010  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -22,6 +22,7 @@ Distributed under the LGPL
 #include "sharedlibrary.h"
 #include "sourcepackage.h"
 #include "staticlibrary.h"
+#include "symlink.h"
 #include "tarball.h"
 #include "target.h"
 
@@ -211,7 +212,14 @@ void Component::create_targets() const
 
        Target *inst_tgt = builder.get_target("install");
        for(list<FileTarget *>::const_iterator i=inst_list.begin(); i!=inst_list.end(); ++i)
-               inst_tgt->add_depend(new Install(builder, pkg, **i, inst_loc));
+       {
+               Install *inst = new Install(builder, pkg, **i, inst_loc);
+               inst_tgt->add_depend(inst);
+
+               if(type==LIBRARY)
+                       if(SharedLibrary *shlib = dynamic_cast<SharedLibrary *>(*i))
+                               inst_tgt->add_depend(new Symlink(builder, pkg, *inst, shlib->get_name()));
+       }
 }
 
 PathList Component::collect_source_files() const