build: improve ccache support