From 3aad704c2d2fac737424a0a2697874927bd95c37 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 17 Mar 2009 11:18:42 +0000 Subject: [PATCH] Fix a problem in finding ObjectFile dependencies Don't fail unlinking if the file didn't exist --- source/builder.cpp | 2 +- source/objectfile.cpp | 6 +++++- source/unlink.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) 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() -- 2.45.2