diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-29 14:25:39 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-29 14:25:59 +0900 |
commit | 5f86e1a2df170eadf0601f1bff6ab12a643a68c5 (patch) | |
tree | d8e9c7bde1d4305ffe3cdf1645a0b839e86d1c79 /main.cc | |
parent | 2a04789470d2de0384753c96e7e278b77a5dc2dc (diff) | |
download | kati-5f86e1a2df170eadf0601f1bff6ab12a643a68c5.tar.gz |
[C++] Split CommandEvaluator from Executor
This is the first step of --ninja support
Diffstat (limited to 'main.cc')
-rw-r--r-- | main.cc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -29,6 +29,7 @@ #include "flags.h" #include "func.h" #include "log.h" +#include "ninja.h" #include "parser.h" #include "string_piece.h" #include "stringprintf.h" @@ -38,6 +39,7 @@ static const char* g_makefile; static bool g_is_syntax_check_only; +static bool g_generate_ninja; static void ParseCommandLine(int argc, char* argv[], vector<StringPiece>* targets, @@ -52,6 +54,8 @@ static void ParseCommandLine(int argc, char* argv[], g_is_dry_run = true; } else if (!strcmp(arg, "--kati_stats")) { g_enable_stat_logs = true; + } else if (!strcmp(arg, "--ninja")) { + g_generate_ninja = true; } else if (arg[0] == '-') { ERROR("Unknown flag: %s", arg); } else { @@ -194,6 +198,12 @@ static int Run(const vector<StringPiece>& targets, if (g_is_syntax_check_only) return 0; + if (g_generate_ninja) { + ScopedTimeReporter tr("generate ninja time"); + GenerateNinja(nodes, ev); + return 0; + } + { ScopedTimeReporter tr("exec time"); Exec(nodes, ev); |