From fefe0657f29b8db782f7a722dd46b074b991cf08 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Feb 2015 15:56:03 +0200 Subject: Redo rule match/build logic Now the rule is fully responsible for searching, matching, and building of prerequisites. --- build/diagnostics | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'build/diagnostics') diff --git a/build/diagnostics b/build/diagnostics index 7e56fa3..e61295a 100644 --- a/build/diagnostics +++ b/build/diagnostics @@ -14,8 +14,27 @@ #include #include +#include + namespace build { + // Throw this exception to terminate the build. The handler should + // assume that the diagnostics has already been issued. + // + class failed: public std::exception {}; + + // In addition to calling relative_work(), this function also uses + // shorter notations such as ~/. + // + std::string + diag_relative_work (const path&); + + inline std::ostream& + operator<< (std::ostream& os, const path& p) + { + return os << diag_relative_work (p); + } + // Print process commmand line. // void @@ -27,11 +46,6 @@ namespace build print_process (args.data ()); } - // Throw this exception to terminate the build. The handler should - // assume that the diagnostics has already been issued. - // - class failed: public std::exception {}; - // Trace verbosity level. // // 1 - command lines to update explicit targets (e.g., .o) -- cgit v1.1