summaryrefslogtreecommitdiffstats
path: root/scripts/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh41
1 files changed, 39 insertions, 2 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index 94c62b8..07b7aa8 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -e
usage() {
echo "Usage: build.sh [-b [release|debug]] "
@@ -18,6 +19,8 @@ usage() {
echo " fallback download all dependencies"
echo " and build them as shared libaries"
echo " cross use cross toolchain to build"
+ echo " coverage build coverage report"
+ echo " appimage build AppImage target"
echo ""
echo "configs with muon:"
echo " [default] minimal static build"
@@ -57,6 +60,8 @@ cd "$(git rev-parse --show-toplevel)" || exit 1
BUILDDIR="$(pwd)/.build-ci"
+fn_exists() { declare -F "$1" > /dev/null; }
+
config_meson_default() {
CC="${CC}" "${MESON}" setup \
--werror \
@@ -89,6 +94,26 @@ config_meson_cross() {
"${BUILDDIR}"
}
+config_meson_coverage() {
+ CC="${CC}" "${MESON}" setup \
+ --werror \
+ --buildtype="${BUILDTYPE}" \
+ --force-fallback-for=libnvme \
+ -Dlibnvme:werror=false \
+ -Db_coverage=true \
+ "${BUILDDIR}"
+}
+
+config_meson_appimage() {
+ CC="${CC}" "${MESON}" setup \
+ --werror \
+ --buildtype="${BUILDTYPE}" \
+ --force-fallback-for=libnvme \
+ --prefix=/usr \
+ -Dlibnvme:werror=false \
+ "${BUILDDIR}"
+}
+
build_meson() {
"${MESON}" compile \
-C "${BUILDDIR}"
@@ -99,6 +124,17 @@ test_meson() {
-C "${BUILDDIR}"
}
+test_meson_coverage() {
+ "${MESON}" test \
+ -C "${BUILDDIR}"
+ ninja -C "${BUILDDIR}" coverage --verbose
+}
+
+install_meson_appimage() {
+ "${MESON}" install \
+ -C "${BUILDDIR}"
+}
+
tools_build_samurai() {
mkdir -p "${BUILDDIR}"/build-tools
git clone --depth 1 https://github.com/michaelforney/samurai.git \
@@ -173,5 +209,6 @@ if [[ "${BUILDTOOL}" == "muon" ]]; then
fi
config_"${BUILDTOOL}"_"${CONFIG}"
-build_"${BUILDTOOL}"
-test_"${BUILDTOOL}"
+fn_exists "build_${BUILDTOOL}_${CONFIG}" && "build_${BUILDTOOL}_${CONFIG}" || build_"${BUILDTOOL}"
+fn_exists "test_${BUILDTOOL}_${CONFIG}" && "test_${BUILDTOOL}_${CONFIG}" || test_"${BUILDTOOL}"
+fn_exists "install_${BUILDTOOL}_${CONFIG}" && "install_${BUILDTOOL}_${CONFIG}" || true;