]> git.tdb.fi Git - builder.git/blobdiff - source/install.cpp
Further changes for library compatibility
[builder.git] / source / install.cpp
index 2b2a5c94f0bae872039104bbfb638cfa4de2b6f2..ecf50ee6cfa1e73f8c8e62d4f7d05f4a6778fc01 100644 (file)
@@ -51,7 +51,7 @@ Action *Install::create_action()
 FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string &loc)
 {
        if(!tgt.get_package())
-               throw InvalidParameterValue("Can't install package-less targets");
+               throw invalid_argument("Can't install package-less targets");
 
        FS::Path base = tgt.get_package()->get_builder().get_prefix();
        string tgtname = FS::basename(tgt.get_path());
@@ -62,7 +62,7 @@ FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string
        else if(const Header *hdr = dynamic_cast<const Header *>(&tgt))
        {
                if(hdr->get_component()->get_type()!=Component::HEADERS)
-                       throw Exception("Header install from non-header component?");
+                       throw logic_error("Header install from non-header component?");
                mid = "include/"+hdr->get_component()->get_name();
        }
        else if(dynamic_cast<const Executable *>(&tgt))
@@ -73,7 +73,8 @@ FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string
                if(comp.get_type()==Component::LIBRARY)
                {
                        mid = "lib";
-                       tgtname = shlib->get_soname();
+                       if(!shlib->get_soname().empty())
+                               tgtname = shlib->get_soname();
                }
                else if(comp.get_type()==Component::MODULE)
                        mid = "lib/"+tgt.get_package()->get_name();
@@ -86,7 +87,7 @@ FS::Path Install::generate_target_path(const FileTarget &tgt, const std::string
                mid = "share/"+tgt.get_package()->get_name();
 
        if(mid.empty())
-               throw InvalidParameterValue("Don't know where to install "+tgtname);
+               throw invalid_argument("Don't know where to install "+tgtname);
 
        return (base/mid/tgtname).str();
 }