#!/usr/bin/env bash # Run a compiled Qt target on the HOST against the ISOLATED Qt 5.14.2 in .qt514/. # Usage: tools/run_qt.sh [args...] # Headless/scriptable: QT_QPA_PLATFORM=offscreen tools/run_qt.sh # Isolation is by LD_LIBRARY_PATH + Qt plugin path, NOT a container. Verified by # ldd: linked Qt libs resolve only to .qt514/, zero refs to system /usr/lib Qt5. set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" target="${1:?usage: tools/run_qt.sh [args...]}" shift || true QT_ROOT="$REPO_ROOT/.qt514/5.14.2/gcc_64" bin=$(find "$REPO_ROOT/build" -type f -name "$target" -executable 2>/dev/null | head -1) || true if [ -z "$bin" ]; then echo "Qt target '$target' not found under $REPO_ROOT/build. Build first." >&2 exit 1 fi export LD_LIBRARY_PATH="$QT_ROOT/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" export QT_PLUGIN_PATH="$QT_ROOT/plugins" export QT_QPA_PLATFORM_PLUGIN_PATH="$QT_ROOT/plugins/platforms" exec "$bin" "$@"