#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" BUILD_DIR="${BUILD_DIR:-$SCRIPT_DIR/build_linux}" BUILD_TYPE="${BUILD_TYPE:-Release}" export CMAKE_BUILD_PARALLEL_LEVEL="${CMAKE_BUILD_PARALLEL_LEVEL:-2}" if [[ "$(uname -s)" != Linux ]]; then echo "ERROR: build_linux.sh requires a Linux host." >&2 exit 1 fi for tool in cmake ninja pkg-config "${CC:-cc}" "${CXX:-c++}"; do if ! command -v "$tool" >/dev/null 2>&1; then echo "ERROR: $tool not found. See README.md prerequisites." >&2 exit 1 fi done echo "Configuring Linux production targets in $BUILD_DIR ($BUILD_TYPE)..." cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -G Ninja \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ -DSERUMALT_BUILD_PLUGIN=ON \ -DSERUMALT_BUILD_TESTS=OFF echo "Building Linux VST3 and standalone..." cmake --build "$BUILD_DIR" --config "$BUILD_TYPE" --target SerumAlt_VST3 SerumAlt_Standalone echo "Done. Linux artifacts: $BUILD_DIR/SerumAlt_artefacts/$BUILD_TYPE"