]> git.tdb.fi Git - builder.git/commitdiff
Make install_location a path
authorMikko Rasa <tdb@tdb.fi>
Tue, 10 Jul 2012 09:24:08 +0000 (12:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 10 Jul 2012 09:24:08 +0000 (12:24 +0300)
source/csourcefile.cpp
source/datafile.cpp
source/installedfile.cpp
source/sharedlibrary.cpp
source/target.h

index 824027890fa940c36c0bcd47de0f3bdc1adcbcfa..3c3aad935f965e7c039ad68bbe3d7419afb832f6 100644 (file)
@@ -19,7 +19,7 @@ CSourceFile::CSourceFile(Builder &b, const Component &c, const FS::Path &p):
 {
        string ext = FS::extpart(FS::basename(path));
        if(ext==".h" || ext==".H" || ext==".hpp")
-               install_location = "include/"+component->get_name();
+               install_location = FS::Path("include")/component->get_name();
 }
 
 void CSourceFile::find_depends()
index 9a47703dd03dab819968e63109e1a0e07f0df353..2e9a7e5bcd067dfe79c2eaa936f627f49e935403 100644 (file)
@@ -10,7 +10,7 @@ DataFile::DataFile(Builder &b, const Component &c, File &s):
 {
        add_depend(&source);
 
-       install_location = "share/"+package->get_name();
+       install_location = Msp::FS::Path("share")/package->get_name();
 }
 
 Msp::FS::Path DataFile::generate_target_path(const Component &comp)
index 0928386c092c24f6dba4b7d1f0c7999d385c41c7..a71bcba3c29adae803f357c1455ad3dc76bae2d5 100644 (file)
@@ -25,7 +25,7 @@ FS::Path InstalledFile::generate_target_path(const FS::Path &prefix, const FileT
        if(!tgt.is_installable() && loc.empty())
                throw invalid_argument(tgt.get_name()+" is not installable");
 
-       string mid;
+       FS::Path mid;
        if(!loc.empty())
                mid = loc;
        else
index 24e0e205682acec12951035b32d84bc26a9a0ece..9b2fdbb1bd99b02bc3a99f877ec67779b4790c31 100644 (file)
@@ -22,10 +22,7 @@ SharedLibrary::SharedLibrary(Builder &b, const Component &c, const list<ObjectFi
 {
        install_location = "lib";
        if(component->get_type()==Component::MODULE)
-       {
-               install_location += '/';
-               install_location += package->get_name();
-       }
+               install_location /= package->get_name();
 
        const string &version = component->get_package().get_version();
        if(!version.empty())
index a69ff5195986e2f47fe4f6e183c9331303a854ea..885ef4b567f00d69d9f04921cd5fca9c46c06568 100644 (file)
@@ -45,7 +45,7 @@ protected:
        const Tool *tool;
        State state;
        std::string rebuild_reason;
-       std::string install_location;
+       Msp::FS::Path install_location;
 
        Dependencies depends;
 
@@ -88,7 +88,7 @@ public:
        void force_rebuild();
 
        bool is_installable() const { return !install_location.empty(); }
-       const std::string &get_install_location() const { return install_location; }
+       const Msp::FS::Path &get_install_location() const { return install_location; }
        void add_depend(Target *);
        const Dependencies &get_depends() const { return depends; }