From 7552ed51f78ca1ad311228f76e90cf8c120ee2f6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 4 Oct 2023 14:52:51 +0200 Subject: Adding upstream version 2.6. Signed-off-by: Daniel Baumann --- scripts/build.sh | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'scripts/build.sh') 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; -- cgit v1.2.3