From 7c8597121bee2e885e7cd740a18aeecd73504bb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 12 Jun 2018 23:11:44 +0200 Subject: [PATCH] Compiler "cc" might still be the same as "clang" It migt also be "gcc", but try to play it safe. --- src/ccache.c | 4 ++-- src/manifest.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ccache.c b/src/ccache.c index 1f1faa0c5..5cff0b77c 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -1711,7 +1711,7 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode) // clang will emit warnings for unused linker flags, so we shouldn't skip // those arguments. - int is_clang = guessed_compiler == GUESSED_CLANG; + int is_clang = (guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN); // First the arguments. for (int i = 1; i < args->argc; i++) { @@ -1970,7 +1970,7 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) // // file 'foo.h' has been modified since the precompiled header 'foo.pch' // was built - if (guessed_compiler == GUESSED_CLANG + if ((guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN) && output_is_precompiled_header && mode == FROMCACHE_CPP_MODE) { cc_log("Not considering cached precompiled header in preprocessor mode"); diff --git a/src/manifest.c b/src/manifest.c index 02df21958..1eeccdf9a 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -383,7 +383,7 @@ verify_object(struct conf *conf, struct manifest *mf, struct object *obj, // Clang stores the mtime of the included files in the precompiled header, // and will error out if that header is later used without rebuilding. - if (guessed_compiler == GUESSED_CLANG + if ((guessed_compiler == GUESSED_CLANG || guessed_compiler == GUESSED_UNKNOWN) && output_is_precompiled_header && fi->mtime != st->mtime) { cc_log("Precompiled header includes %s, which has a new mtime", path); -- 2.47.2