g++, colorgcc and ccache

后端 未结 7 2013
庸人自扰
庸人自扰 2021-02-04 01:45

Trying to combine ccache and colorgcc. Following link text:

  • my g++ is soft link to colorgcc
  • ~/.colorgccrc contains line: \"g++: ccache /usr/bin/g++\"
7条回答
  •  死守一世寂寞
    2021-02-04 02:17

    For me the best solution is this one. After installing ccache on Fedora I have following in my PATH:

    PATH=/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin

    and gcc command will call ccache binary:

    which gcc

    /usr/lib64/ccache/gcc

    To create a call chain gcc -> color-gcc -> ccache -> gcc

    I need just to create following aliases:

    alias gcc="color-gcc"
    alias g++="color-gcc"
    

    Put these two lines at the end of ~/.bashrc and you are done! No need to create the symlinks or fix the color-gcc source.

    (In case you are using other shell than BASH you will need to put the aliases into the appropriate shell settings file)

    Jirka

提交回复
热议问题