]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Compiler "cc" might still be the same as "clang"
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Tue, 12 Jun 2018 21:11:44 +0000 (23:11 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 14 Aug 2018 19:39:15 +0000 (21:39 +0200)
It migt also be "gcc", but try to play it safe.

src/ccache.c
src/manifest.c

index 1f1faa0c5cb339669aa5fc0a328b67d7ca68946c..5cff0b77cda005a1f01de03a6839a8af68bdfd4d 100644 (file)
@@ -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");
index 02df219585037065b82de38af2ef964368998f4f..1eeccdf9a1c96ce698c1ecc77cb8fa8a8c22bebc 100644 (file)
@@ -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);