Fix ccache compiler aliases being first in PATH

Add ccache symlink directory to start of PATH, this must be after
`typeset -U PATH` because on macOS this reorders the list so ccache's
symlinks will no longer be at the start of PATH rendering it unusable.
This commit is contained in:
2018-04-21 16:59:35 +01:00
parent 0ecc231c18
commit 5a1ef73524
2 changed files with 11 additions and 3 deletions

11
zshrc
View File

@@ -117,6 +117,17 @@ typeset -U PATH
typeset -U MANPATH
typeset -U INFOPATH
# Add ccache symlink directory to start of PATH, this must be after
# `typeset -U PATH` because on macOS this reorders the list so ccache's
# symlinks will no longer be at the start of PATH rendering it unusable.
if [ `uname` = Darwin ]; then
[ -f /usr/local/bin/ccache ] && \
PATH=/usr/local/opt/ccache/libexec:$PATH
else
[ -f /usr/bin/ccache ] && \
PATH=/usr/lib/ccache:$PATH
fi
# Aliases
alias grep='grep --color=always'
alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON'