diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-26 08:02:45 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-26 16:42:24 +0900 |
commit | 08808d3a778e6b4b653372b6d08dd4da96ebee27 (patch) | |
tree | 54764055bcb3ec63f236b272c72846636438d2ea /exec.cc | |
parent | 2bed770578c05fde7a05d2f11782bfd167abd43c (diff) | |
download | kati-08808d3a778e6b4b653372b6d08dd4da96ebee27.tar.gz |
[C++] Add -c flag
Diffstat (limited to 'exec.cc')
-rw-r--r-- | exec.cc | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -28,6 +28,7 @@ #include "dep.h" #include "eval.h" #include "fileutil.h" +#include "flags.h" #include "log.h" #include "string_piece.h" #include "strutil.h" @@ -160,15 +161,17 @@ class Executor { printf("%s\n", runner->cmd->c_str()); fflush(stdout); } - int result = system(runner->cmd->c_str()); - if (result != 0) { - if (runner->ignore_error) { - fprintf(stderr, "[%.*s] Error %d (ignored)\n", - SPF(runner->output), WEXITSTATUS(result)); - } else { - fprintf(stderr, "*** [%.*s] Error %d\n", - SPF(runner->output), WEXITSTATUS(result)); - exit(1); + if (!g_is_syntax_check_only) { + int result = system(runner->cmd->c_str()); + if (result != 0) { + if (runner->ignore_error) { + fprintf(stderr, "[%.*s] Error %d (ignored)\n", + SPF(runner->output), WEXITSTATUS(result)); + } else { + fprintf(stderr, "*** [%.*s] Error %d\n", + SPF(runner->output), WEXITSTATUS(result)); + exit(1); + } } } delete runner; |