summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Landden <slandden@gmail.com>2018-02-25 02:52:09 -0800
committerOmer Katz <omer.drow@gmail.com>2018-02-25 12:52:09 +0200
commit09656168b2a981484fba1814b02de0f12ecf2407 (patch)
tree422967fdea25f24f7f35dbb5c6aba5fd6c9ec450
parent1fb7a2cf2164ec0c053a3bdabd4cafe5ac859421 (diff)
downloaddistcc-git-09656168b2a981484fba1814b02de0f12ecf2407.tar.gz
support some of gcc's most sensible -x options (#252)
Includes objective-c and go support
-rw-r--r--src/arg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arg.c b/src/arg.c
index 0e7644e..cd82bf0 100644
--- a/src/arg.c
+++ b/src/arg.c
@@ -212,8 +212,15 @@ int dcc_scan_args(char *argv[], char **input_file, char **output_file,
} else if (!strcmp(a, "-frepo")) {
rs_log_info("compiler will emit .rpo files; must be local");
return EXIT_DISTCC_FAILED;
- } else if (str_startswith("-x", a)) {
- rs_log_info("gcc's -x handling is complex; running locally");
+ } else if (str_startswith("-x", a)
+ && argv[i+1]
+ && !str_startswith("c", argv[i+1])
+ && !str_startswith("c++", argv[i+1])
+ && !str_startswith("objective-c", argv[i+1])
+ && !str_startswith("objective-c++", argv[i+1])
+ && !str_startswith("go", argv[i+1])
+ ) {
+ rs_log_info("gcc's -x handling is complex; running locally for %s", argv[i+1] ? argv[i+1] : "empty");
return EXIT_DISTCC_FAILED;
} else if (str_startswith("-dr", a)) {
rs_log_info("gcc's debug option %s may write extra files; "