我们的系统支持使用三种不同的工具链(gcc,icc,diab)构建。我不确定在这种情况下使用ccache是否安全。我关注的是:如果我使用gcc构建,然后使用diab重建,在文件及其依赖项相同的情况下,我会获得ccache命中吗?
我在这种情况下不想要点击,因为我希望用diab重新编译文件。
答案 0 :(得分:4)
您不会在不同编译器之间获得ccache命中。编译器经过哈希处理。此外,您可以更改环境变量CCACHE_COMPILERCHECK以不同的方式检查编译器。 如ccache manual中所示:
For both modes, the following information is included in the hash:
the extension used by the compiler for a file with preprocessor output (normally .i for C code and .ii for C++ code)
the compiler’s size and modification time (or other compiler-specific information specified by CCACHE_COMPILERCHECK)
the name of the compiler
the current directory (if CCACHE_HASHDIR is set)
contents of files specified by CCACHE_EXTRAFILES (if any)