aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-08 13:27:15 +0200
commitab4421747146aa7995f0cfb1a639c9121c82c915 (patch)
treedeb08893c02ed0238f73becbbe80ede5568b946e /build/diagnostics
parentd3e624ef7c0fb274e62b81c4c7bd59640770520a (diff)
Implement tracing support
Also use to-relative path translation in diagnostics.
Diffstat (limited to 'build/diagnostics')
-rw-r--r--build/diagnostics14
1 files changed, 14 insertions, 0 deletions
diff --git a/build/diagnostics b/build/diagnostics
index c8fb169..98f481f 100644
--- a/build/diagnostics
+++ b/build/diagnostics
@@ -6,9 +6,12 @@
#define BUILD_DIAGNOSTICS
#include <tuple>
+#include <vector>
#include <utility>
#include <exception>
+#include <build/trace>
+
namespace build
{
// Throw this exception to terminate the build. The handler should
@@ -16,6 +19,17 @@ namespace build
//
class error: public std::exception {};
+ // Print process commmand line.
+ //
+ void
+ print_process (const char* const* args);
+
+ inline void
+ print_process (const std::vector<const char*>& args)
+ {
+ print_process (args.data ());
+ }
+
// Call a function if there is an exception.
//
template <typename F, typename T>