aboutsummaryrefslogtreecommitdiff
path: root/exec.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-26 08:02:45 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-26 16:42:24 +0900
commit08808d3a778e6b4b653372b6d08dd4da96ebee27 (patch)
tree54764055bcb3ec63f236b272c72846636438d2ea /exec.cc
parent2bed770578c05fde7a05d2f11782bfd167abd43c (diff)
downloadkati-08808d3a778e6b4b653372b6d08dd4da96ebee27.tar.gz
[C++] Add -c flag
Diffstat (limited to 'exec.cc')
-rw-r--r--exec.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/exec.cc b/exec.cc
index d46541f..bc4497f 100644
--- a/exec.cc
+++ b/exec.cc
@@ -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;