具有相同代码库和多个工具链的ccache

Ben*_*Ben 6 gcc icc ccache

我们的系统支持使用三种不同的工具链(gcc,icc,diab)进行构建。我不确定在这种情况下使用ccache是​​否安全。我的担心如下:如果我使用gcc进行构建,然后使用diab进行重建,那么在文件及其依赖项相同的情况下,是否会遇到ccache问题?

在这种情况下,我希望受到打击,因为我希望使用diab重新编译文件。

Mat*_*sdm 7

您不会在不同的编译器之间碰到ccache。编译器被散列。此外,您可以更改环境变量CCACHE_COMPILERCHECK以其他方式检查编译器。如ccache手册中所述

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)
Run Code Online (Sandbox Code Playgroud)