aboutsummaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-27 16:58:36 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-29 12:26:47 +0900
commit64cd806d57dfdc9d2b848f47aa583a872a7c6dcb (patch)
tree916f11700f297278f3815e3b6631d4c0123d7d9e /main.cc
parente36dd56bebb7d364d9e2596458ff332d0a9a3411 (diff)
downloadandroid_build_kati-64cd806d57dfdc9d2b848f47aa583a872a7c6dcb.tar.gz
android_build_kati-64cd806d57dfdc9d2b848f47aa583a872a7c6dcb.tar.bz2
android_build_kati-64cd806d57dfdc9d2b848f47aa583a872a7c6dcb.zip
[C++] Fix -c flag and add -i flag
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.cc b/main.cc
index 3bb9fe6..3b503fa 100644
--- a/main.cc
+++ b/main.cc
@@ -36,6 +36,7 @@
#include "var.h"
static const char* g_makefile;
+static bool g_is_syntax_check_only;
static void ParseCommandLine(int argc, char* argv[],
vector<StringPiece>* targets,
@@ -46,6 +47,8 @@ static void ParseCommandLine(int argc, char* argv[],
g_makefile = argv[++i];
} else if (!strcmp(arg, "-c")) {
g_is_syntax_check_only = true;
+ } else if (!strcmp(arg, "-i")) {
+ g_is_dry_run = true;
} else if (arg[0] == '-') {
ERROR("Unknown flag: %s", arg);
} else {
@@ -179,6 +182,9 @@ static int Run(const vector<StringPiece>& targets,
}
}
+ if (g_is_syntax_check_only)
+ return 0;
+
Exec(nodes, ev);
for (AST* ast : bootstrap_asts)
@@ -187,7 +193,7 @@ static int Run(const vector<StringPiece>& targets,
delete vars;
delete cache_mgr;
- return mk == 0;
+ return 0;
}
int main(int argc, char* argv[]) {