From 1ef587f552d97c67cbc068cd7a66b830d77e04a9 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 12 Jan 2023 19:15:36 +0100 Subject: [PATCH] Add build.sh ci option to allow for easier co-operation of native and devcontainer builds in the same workspace Signed-off-by: DL6ER --- build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index c969f427..b83062a4 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,9 @@ # Abort script if one command returns a non-zero value set -e +# Set builddir +builddir="cmake/" + # Parse arguments for var in "$@" do @@ -20,6 +23,7 @@ do "-C" | "CLEAN" ) clean=1 && nobuild=1;; "-i" | "install" ) install=1;; "-t" | "test" ) test=1;; + "ci" ) builddir="cmake_ci/";; esac done @@ -27,7 +31,7 @@ done if [[ -n "${clean}" ]]; then echo "Cleaning build environment" # Remove build directory - rm -rf cmake/ + rm -rf "${builddir}" if [[ -n ${nobuild} ]]; then exit 0 fi @@ -59,8 +63,8 @@ done # Configure build, pass CMake CACHE entries if present # Wrap multiple options in "" as first argument to ./build.sh: # ./build.sh "-DA=1 -DB=2" install -mkdir -p cmake -cd cmake +mkdir -p "${builddir}" +cd "${builddir}" if [[ "${1}" == "-D"* ]]; then cmake "${1}" .. else