]> git.tdb.fi Git - builder.git/blobdiff - source/sourcefile.cpp
Further changes for library compatibility
[builder.git] / source / sourcefile.cpp
index 3a1941af4b76b8ea41266ef6d237bdf846e10962..bc2d993f819d1dbed22c7ca868697e3dd4f0139e 100644 (file)
@@ -5,8 +5,8 @@ Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
+#include <msp/core/maputils.h>
 #include <msp/fs/utils.h>
-#include <msp/io/except.h>
 #include <msp/io/print.h>
 #include <msp/strings/regex.h>
 #include "builder.h"
@@ -36,7 +36,7 @@ void SourceFile::find_depends()
        }
 
        const SourcePackage &spkg = comp->get_package();
-       string relname = FS::relative(name, spkg.get_source()).str();
+       string relname = FS::relative(path, spkg.get_source()).str();
        DependencyCache &deps_cache = spkg.get_deps_cache();
        bool deps_found = false;
        if(mtime<deps_cache.get_mtime())
@@ -46,7 +46,7 @@ void SourceFile::find_depends()
                        includes = deps_cache.get_deps(relname);
                        deps_found = true;
                }
-               catch(const KeyError &)
+               catch(const key_error &)
                { }
        }
 
@@ -54,10 +54,10 @@ void SourceFile::find_depends()
        {
                try
                {
-                       IO::BufferedFile in(name);
+                       IO::BufferedFile in(path.str());
 
                        if(builder.get_verbose()>=4)
-                               IO::print("Reading includes from %s\n", name);
+                               IO::print("Reading includes from %s\n", path.str());
 
                        Regex r_include("^[ \t]*#include[ \t]+([\"<].*)[\">]");
 
@@ -68,9 +68,11 @@ void SourceFile::find_depends()
 
                        deps_cache.set_deps(relname, includes);
                }
-               catch(const IO::FileNotFound &)
+               catch(const IO::file_not_found &)
                {
-                       // XXX WTF?
+                       if(builder.get_verbose()>=4)
+                               IO::print("Failed to read includes from %s\n", path.str());
+                       deps_ready = true;
                        return;
                }
        }