From: Anders F Björklund Date: Tue, 21 Aug 2018 20:22:38 +0000 (+0200) Subject: Bail out on compiler option -save-temps=obj X-Git-Tag: v3.4.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec228389e6e0efeefafcd04edbad14cee2eb61c1;p=thirdparty%2Fccache.git Bail out on compiler option -save-temps=obj Also add a test, and handle default (=cwd) Closes #299 --- diff --git a/src/compopt.c b/src/compopt.c index 0df2bd0a8..63351acb0 100644 --- a/src/compopt.c +++ b/src/compopt.c @@ -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}, diff --git a/unittest/test_compopt.c b/unittest/test_compopt.c index 2efda5021..fb50f357b 100644 --- a/unittest/test_compopt.c +++ b/unittest/test_compopt.c @@ -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"));