#include <msp/core/getopt.h>
#include <msp/datafile/parser.h>
#include <msp/io/buffered.h>
+#include <msp/io/except.h>
#include <msp/io/file.h>
#include <msp/path/utils.h>
#include <msp/strings/formatter.h>
*/
int Builder::load_build_file(const Path &fn)
{
- IO::File inf(fn.str());
- IO::Buffered in(inf);
+ try
+ {
+ IO::File inf(fn.str());
+ IO::Buffered in(inf);
- if(verbose>=3)
- cout<<"Reading "<<fn<<'\n';
+ if(verbose>=3)
+ cout<<"Reading "<<fn<<'\n';
- DataFile::Parser parser(in, fn.str());
- Loader loader(*this, fn.subpath(0, fn.size()-1));
- loader.load(parser);
+ DataFile::Parser parser(in, fn.str());
+ Loader loader(*this, fn.subpath(0, fn.size()-1));
+ loader.load(parser);
+ }
+ catch(const IO::FileNotFound &)
+ {
+ return -1;
+ }
return 0;
}