From: Mikko Rasa Date: Tue, 17 Mar 2009 11:18:42 +0000 (+0000) Subject: Fix a problem in finding ObjectFile dependencies X-Git-Tag: 1.0~17 X-Git-Url: http://git.tdb.fi/?p=builder.git;a=commitdiff_plain;h=3aad704c2d2fac737424a0a2697874927bd95c37 Fix a problem in finding ObjectFile dependencies Don't fail unlinking if the file didn't exist --- diff --git a/source/builder.cpp b/source/builder.cpp index bbf6eb1..cf335c1 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -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 "<is_native()) diff --git a/source/objectfile.cpp b/source/objectfile.cpp index 6183d20..ba20f7d 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -48,15 +48,19 @@ void ObjectFile::find_depends() void ObjectFile::find_depends(Target *tgt) { SourceFile *src=dynamic_cast(tgt); + FileTarget *file=src; if(!src) { if(Install *inst=dynamic_cast(tgt)) + { + file=inst; src=dynamic_cast(&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 &includes=src->get_includes(); diff --git a/source/unlink.cpp b/source/unlink.cpp index 458f5a9..fbe6388 100644 --- a/source/unlink.cpp +++ b/source/unlink.cpp @@ -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()