should be a comma-separated string with options. Available options are:
+
--
+*clang_index_store*::
+ Ignore the Clang compiler option *-index-store-path* and its argument when
+ computing the manifest hash. This is useful if you use Xcode, which uses an
+ index store path derived from the local project path. Note that the index
+ store won't be updated correctly on cache hits if you enable this option.
*file_macro*::
ccache normally includes the input file path in the hash in order to be
- able to produce the correct object file if the source code includes a
- `__FILE__` macro. If you know that `__FILE__` isn't used in practise, or
- don't care if ccache produces objects where `__FILE__` is expanded to the
- wrong path, you can set *sloppiness* to *file_macro*. ccache will then
- exclude the input file path from the hash.
+ able to produce the correct object file if the source code includes a
+ `__FILE__` macro. If you know that `__FILE__` isn't used in practise, or
+ don't care if ccache produces objects where `__FILE__` is expanded to the
+ wrong path, you can set *sloppiness* to *file_macro*. ccache will then
+ exclude the input file path from the hash.
*file_stat_matches*::
ccache normally examines a file's contents to determine whether it matches
the cached version. With this option set, ccache will consider a file as
<<_precompiled_headers,PRECOMPILED HEADERS>> for more information.
*time_macros*::
Ignore `__DATE__` and `__TIME__` being present in the source code.
-*clang_index_store*::
- Ignore the Clang compiler option *-index-store-path* and its argument when
- computing the manifest hash. This is useful if you use Xcode, which uses an
- index store path derived from the local project path. Note that the index
- store won't be updated correctly on cache hits if you enable this option.
--
+
See the discussion under <<_troubleshooting,TROUBLESHOOTING>> for more
continue;
}
- if (conf->sloppiness & SLOPPY_CLANG_INDEX_STORE) {
- // Xcode 9 or later calls clang with this option.
- // The given path has a UUID path which might break the manifest
- // especially when cache is shared among multple machines.
- if (str_eq(argv[i], "-index-store-path")) {
- i++;
- cc_log("Skip argument -index-store-path %s", argv[i]);
- continue;
+ if (conf->sloppiness & SLOPPY_CLANG_INDEX_STORE
+ && str_eq(argv[i], "-index-store-path")) {
+ // Xcode 9 or later calls Clang with this option. The given path includes
+ // a UUID that might lead to cache misses, especially when cache is
+ // shared among multple users.
+ i++;
+ if (i <= argc - 1) {
+ cc_log("Skipping argument -index-store-path %s", argv[i]);
}
+ continue;
}
// Options taking an argument that we may want to rewrite to relative paths
// Allow us to ignore ctimes when comparing file stats, so we can fake mtimes
// if we want to (it is much harder to fake ctimes, requires changing clock)
#define SLOPPY_FILE_STAT_MATCHES_CTIME 128
-// Allow us to not include -index-store-path option in the manifest,
-// so that ccache can use with Xcode build.
+// Allow us to not include the -index-store-path option in the manifest hash.
#define SLOPPY_CLANG_INDEX_STORE 256
#define str_eq(s1, s2) (strcmp((s1), (s2)) == 0)