]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Bail out on compiler option -save-temps=obj
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Tue, 21 Aug 2018 20:22:38 +0000 (22:22 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 23 Aug 2018 20:19:06 +0000 (22:19 +0200)
Also add a test, and handle default (=cwd)

Closes #299

src/compopt.c
unittest/test_compopt.c

index 0df2bd0a86ac4f69308290b5c192bae916e82dd8..63351acb0a6798062423262d24608bb4fa6cc25d 100644 (file)
@@ -35,6 +35,8 @@ static const struct compopt compopts[] = {
        {"--output-directory", AFFECTS_CPP | TAKES_ARG}, // nvcc
        {"--param",         TAKES_ARG},
        {"--save-temps",    TOO_HARD},
+       {"--save-temps=cwd",TOO_HARD},
+       {"--save-temps=obj",TOO_HARD},
        {"--serialize-diagnostics", TAKES_ARG | TAKES_PATH},
        {"-A",              TAKES_ARG},
        {"-B",              TAKES_ARG | TAKES_CONCAT_ARG | TAKES_PATH},
@@ -86,6 +88,8 @@ static const struct compopt compopts[] = {
        {"-odir",           AFFECTS_CPP | TAKES_ARG}, // nvcc
        {"-remap",          AFFECTS_CPP},
        {"-save-temps",     TOO_HARD},
+       {"-save-temps=cwd", TOO_HARD},
+       {"-save-temps=obj", TOO_HARD},
        {"-stdlib=",        AFFECTS_CPP | TAKES_CONCAT_ARG},
        {"-trigraphs",      AFFECTS_CPP},
        {"-u",              TAKES_ARG | TAKES_CONCAT_ARG},
index 2efda50213e8c0e29c689037c7495113c966732d..fb50f357b68c9ea9f03062e85c621351bb7eed2c 100644 (file)
@@ -55,6 +55,21 @@ TEST(dash_MM_too_hard)
        CHECK(compopt_too_hard("-MM"));
 }
 
+TEST(dash_save_temps_too_hard)
+{
+       CHECK(compopt_too_hard("-save-temps"));
+}
+
+TEST(dash_save_temps_cwd_too_hard)
+{
+       CHECK(compopt_too_hard("-save-temps=cwd"));
+}
+
+TEST(dash_save_temps_obj_too_hard)
+{
+       CHECK(compopt_too_hard("-save-temps=obj"));
+}
+
 TEST(dash_MD_not_too_hard)
 {
        CHECK(!compopt_too_hard("-MD"));