]> git.tdb.fi Git - builder.git/commitdiff
Fix a problem in finding ObjectFile dependencies
authorMikko Rasa <tdb@tdb.fi>
Tue, 17 Mar 2009 11:18:42 +0000 (11:18 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 17 Mar 2009 11:18:42 +0000 (11:18 +0000)
Don't fail unlinking if the file didn't exist

source/builder.cpp
source/objectfile.cpp
source/unlink.cpp

index bbf6eb1d046dbf8fee32e4d2279de3d2ccaad329..cf335c1a93a6c0f7248e20b2f46cb19d3c4efafb 100644 (file)
@@ -340,7 +340,7 @@ Target *Builder::get_header(const string &include, const FS::Path &from, const l
 
        string fn=include.substr(1);
        if(verbose>=5)
-               cout<<"Looking for include "<<fn<<" with path "<<join(path.begin(), path.end())<<'\n';
+               cout<<"Looking for include "<<fn<<" from "<<from<<" with path "<<join(path.begin(), path.end())<<'\n';
 
        StringList syspath;
        if(current_arch->is_native())
index 6183d20de19285900e11c177a2b804ecbd096f16..ba20f7d8bde6428e0a951536a78f9d7cc8385a7c 100644 (file)
@@ -48,15 +48,19 @@ void ObjectFile::find_depends()
 void ObjectFile::find_depends(Target *tgt)
 {
        SourceFile *src=dynamic_cast<SourceFile *>(tgt);
+       FileTarget *file=src;
        if(!src)
        {
                if(Install *inst=dynamic_cast<Install *>(tgt))
+               {
+                       file=inst;
                        src=dynamic_cast<SourceFile *>(&inst->get_source());
+               }
        }
        if(!src)
                return;
 
-       FS::Path spath=FS::dirname(src->get_path());
+       FS::Path spath=FS::dirname(file->get_path());
        const StringList &incpath=comp.get_build_info().incpath;
 
        const list<string> &includes=src->get_includes();
index 458f5a904f7c5207837c23c33a59e57a868db435..fbe6388c90bacf02532f1a43e65bec73a903cd25 100644 (file)
@@ -17,7 +17,12 @@ Unlink::Unlink(Builder &b, const FileTarget &t):
 
        announce(spkg.get_name(), "RM", relative(t.get_path(), spkg.get_source()).str());
 
-       unlink(t.get_path());
+       try
+       {
+               unlink(t.get_path());
+       }
+       catch(const Msp::SystemError &)
+       { }
 }
 
 int Unlink::check()