diff --git a/docker/build.sh b/docker/build.sh index 3a467b9f..1a3cf2b9 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -26,6 +26,7 @@ export GCC_ARM_PATH="gcc-arm-none-eabi-$GCC_ARM_VER" main() { local target="$1" + shift mkdir -p "$TOOLS_DIR" @@ -35,7 +36,7 @@ main() { mkdir -p "$BUILD_DIR" - CmakeGenerate + CmakeGenerate "$@" CmakeBuild $target BUILD_RESULT=$? if [ "$DISABLE_POSTBUILD" != "true" -a "$BUILD_RESULT" == 0 ]; then @@ -68,13 +69,16 @@ CmakeGenerate() { -DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_PATH" \ -DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \ -DBUILD_DFU=1 \ - -DBUILD_RESOURCES=1 + -DBUILD_RESOURCES=1 \ + "$@" } +# CmakeBuild [target [CMAKE_ARGS...]] +# CMAKE_ARGS can include a '--' arg, with the same meaning as it has in 'cmake'. CmakeBuild() { local target="$1" - [ -n "$target" ] && target="--target $target" - cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) + [ -n "$target" ] && target="--target $target" && shift + cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target "$@" -- -j$(nproc) BUILD_RESULT=$? return $BUILD_RESULT }