rename binary name to gammaray-mcp-bridge

This commit is contained in:
2026-07-08 13:26:08 +08:00
parent 83df5286c5
commit a6335429e5
10 changed files with 114 additions and 68 deletions

View File

@@ -20,9 +20,32 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
: "${GAMMARAY_LIB_DIR:=$PROJECT_ROOT/install-prefix/lib}"
: "${WIDGET_TEST_APP_BIN:=$SCRIPT_DIR/testapp/widget_test_app}"
: "${WIDGET_TEST_APP_SRC:=$SCRIPT_DIR/testapp/widget_test_app.cpp}"
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/qml-sg-mcp-bridge}"
: "${BRIDGE_EXE:=$PROJECT_ROOT/bridge/build/gammaray-mcp-bridge}"
: "${BRIDGE_RUN_SCRIPT:=$PROJECT_ROOT/bridge/run.sh}"
# ---------------------------------------------------------------------------
# Ensure the widget test app is compiled
# ---------------------------------------------------------------------------
_compile_widget_app() {
echo "Compiling widget test app..."
local cflags
cflags=$(pkg-config --cflags Qt6Core Qt6Gui Qt6Widgets 2>/dev/null) || {
echo "Error: pkg-config for Qt6 not found. Install qt6-base-dev or set WIDGET_TEST_APP_BIN to a pre-built binary."
exit 1
}
local libs
libs=$(pkg-config --libs Qt6Core Qt6Gui Qt6Widgets 2>/dev/null) || {
echo "Error: pkg-config for Qt6 libs not found."
exit 1
}
g++ -std=c++17 -fPIC "$WIDGET_TEST_APP_SRC" -o "$WIDGET_TEST_APP_BIN" \
$cflags $libs
echo "Widget test app compiled: $WIDGET_TEST_APP_BIN"
}
if [ ! -f "$WIDGET_TEST_APP_BIN" ]; then
_compile_widget_app
fi
export GAMMARAY_BIN
export GAMMARAY_LIB_DIR
export WIDGET_TEST_APP_BIN