bash.d/20-ninja

12 lines
459 B
Text
Raw Normal View History

# shellcheck shell=bash
# Configure C/C++ build tools:
# - Use Ninja instead of Make for CMake builds (faster parallel builds)
# - Use ccache to cache compilations and speed up rebuilds
if command -v ninja &>/dev/null; then
export NINJA_STATUS="[%e sec | %p (%u remaining) | %o / sec] "
export CMAKE_GENERATOR=Ninja
fi
if command -v ccache &>/dev/null; then
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
fi