]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add handling of separate -target parameter
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Tue, 3 Jul 2018 16:54:34 +0000 (18:54 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 14 Aug 2018 19:47:20 +0000 (21:47 +0200)
Otherwise you will get an error in the log:

"x86_64-pc-linux-gnu is not a regular file,
 not considering as input file"

The argument seems to be specific to clang.

src/ccache.c

index 848eecbb9d6db498aa1effaaa2bb9d1f521bffad..909a74191c6de7ece591f51fe9a3fb828ffdae67 100644 (file)
@@ -2511,6 +2511,19 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                        free(relpath);
                        continue;
                }
+               // Alternate form of specifying target without =
+               if (str_eq(argv[i], "-target")) {
+                       if (i == argc-1) {
+                               cc_log("Missing argument to %s", argv[i]);
+                               stats_update(STATS_ARGS);
+                               result = false;
+                               goto out;
+                       }
+                       args_add(stripped_args, argv[i]);
+                       args_add(stripped_args, argv[i+1]);
+                       i++;
+                       continue;
+               }
                if (str_startswith(argv[i], "-Wp,")) {
                        if (str_eq(argv[i], "-Wp,-P")
                            || strstr(argv[i], ",-P,")