Skip to content
Snippets Groups Projects
Commit 60a86a60 authored by Damiano Amatruda's avatar Damiano Amatruda
Browse files

[SBS] Do not use Ccache and Ninja if not found

parent 8f9b89e0
Branches
Tags
No related merge requests found
...@@ -39,17 +39,23 @@ print_banner() { ...@@ -39,17 +39,23 @@ print_banner() {
EOF EOF
} }
show_found_deps() {
printf "Found Ccache: "; [ $ccache_found ] && echo "yes" || echo "no"
printf "Found Ninja: "; [ $ninja_found ] && echo "yes" || echo "no"
echo
}
configure() { configure() {
mkdir -p "$build_dir" && \ show_found_deps
cd "$build_dir" && \ [ $ccache_found ] && config_ccache="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
[ $ninja_found ] && config_ninja="-GNinja"
cmake \ cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ -B "$build_dir" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ $config_ccache \
-DCMAKE_TOOLCHAIN_FILE="$sbs_base/libs/miosix-kernel/miosix/_tools/toolchain.cmake" \ -DCMAKE_TOOLCHAIN_FILE="$sbs_base/libs/miosix-kernel/miosix/_tools/toolchain.cmake" \
-GNinja \ $config_ninja \
$config_verbose \ $config_verbose \
"$source_dir" && \ "$source_dir"
cd "$source_dir"
} }
clean() { [ -d "$build_dir" ] && cmake --build "$build_dir" $build_jobs --target clean; rm -rf "$build_dir"; } clean() { [ -d "$build_dir" ] && cmake --build "$build_dir" $build_jobs --target clean; rm -rf "$build_dir"; }
...@@ -93,6 +99,9 @@ build_dir="$source_dir/build" ...@@ -93,6 +99,9 @@ build_dir="$source_dir/build"
config_verbose= config_verbose=
build_jobs= build_jobs=
ccache_found="$(command -v ccache)"
ninja_found="$(command -v ninja)"
for arg in "$@"; do for arg in "$@"; do
shift shift
case "$arg" in case "$arg" in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment