How to Use CCache with CMake?

前端 未结 8 747
陌清茗
陌清茗 2020-12-02 09:32

I would like to do the following: If CCache is present in PATH, use \"ccache g++\" for compilation, else use g++. I tried writing a small my-cmake script containing

8条回答
  •  猫巷女王i
    2020-12-02 10:14

    In my opinion the best way is to symlink gcc,g++ to ccache, but if you would like to use within cmake, try this:

    export CC="ccache gcc" CXX="ccache g++" cmake ...
    

提交回复
热议问题