Skip to content

Commit

Permalink
chore(build): Add compiler option to run-build.sh (#294)
Browse files Browse the repository at this point in the history
This change allows passing a second argument to run-build.sh to specify
the compiler. So far the options can be gcc (default) or clang.

Signed-off-by: guillex <[email protected]>
  • Loading branch information
lgsilva3087 authored Feb 5, 2025
1 parent e072eba commit 0c0a465
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/ci_build/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ usage() {
cat <<-EOT
Builds saunafs with different configurations
Usage: run-build.sh [OPTION]
Usage: run-build.sh [OPTION] [COMPILER]
Options:
coverage Build with parameters for coverage report
test Build for test
release Build with no debug info
Compiler:
gcc Use GCC (default)
clang Use Clang
EOT
exit 1
}
Expand All @@ -32,6 +36,23 @@ declare -a CMAKE_SAUNAFS_ARGUMENTS=(
[ -n "${1:-}" ] || usage
declare build_type="${1}"
shift

declare compiler="${1:-gcc}"
shift || true

case "${compiler,,}" in
gcc)
;;
clang)
CMAKE_SAUNAFS_ARGUMENTS+=(
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
)
;;
*) die "Unsupported compiler: ${compiler}"
;;
esac

declare build_dir
declare -a make_extra_args=("${@}")
case "${build_type,,}" in
Expand Down

0 comments on commit 0c0a465

Please sign in to comment.