]> git.tdb.fi Git - builder.git/blobdiff - source/install.cpp
Make symlink a feature of the Install target rather than a target on its own
[builder.git] / source / install.cpp
index 6f6bca3432266ef1d4ee70950dea45f835aab946..f0cce2301c587729afff93cb4a3760d1b8b0b34d 100644 (file)
@@ -19,6 +19,13 @@ Install::Install(Builder &b, const SourcePackage &p, FileTarget &s, const std::s
 {
        buildable = true;
        add_depend(&source);
+
+       if(const SharedLibrary *shlib = dynamic_cast<const SharedLibrary *>(&source))
+               if(!shlib->get_soname().empty())
+                       link = FS::dirname(path)/FS::basename(shlib->get_path());
+
+       if(!link.empty())
+               builder.register_path(link, this);
 }
 
 Target *Install::get_real_target()
@@ -38,7 +45,7 @@ void Install::check_rebuild()
 
 Action *Install::create_action()
 {
-       return new Copy(builder, *package, source.get_path(), path);
+       return new Copy(builder, *package, source.get_path(), path, link);
 }
 
 FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string &loc)