- string line;
- while(getline(in, line))
- if(RegMatch match=r_include.match(line))
- includes.push_back(match[1].str);
+ if(builder.get_verbose()>=4)
+ IO::print("Reading includes from %s\n", path.str());
+
+ Regex r_include("^[ \t]*#include[ \t]+([\"<].*)[\">]");
+
+ string line;
+ while(in.getline(line))
+ if(RegMatch match = r_include.match(line))
+ includes.push_back(match[1].str);
+
+ deps_cache.set_deps(relname, includes);
+ }
+ catch(const IO::FileNotFound &)
+ {
+ if(builder.get_verbose()>=4)
+ IO::print("Failed to read includes from %s\n", path.str());
+ deps_ready = true;
+ return;
+ }
+ }