#!/usr/bin/sh
prefix=/opt/gtlab/gtld-analyzer
export LD_LIBRARY_PATH="$prefix/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export QT_PLUGIN_PATH="$prefix/plugins"
export QML2_IMPORT_PATH="$prefix/qml"
# The application needs its embedded units even when disk caching is disabled.
if [ -n "${QML_DISABLE_DISK_CACHE:-}" ]; then
    unset QML_DISABLE_DISK_CACHE
    export QML_DISK_CACHE=aot
elif [ "${QML_DISK_CACHE+x}" ]; then
    export QML_DISK_CACHE="${QML_DISK_CACHE},aot"
fi
# Use the desktop's file chooser with the bundled Qt platform plugin.
if [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]; then
    export QT_QPA_PLATFORMTHEME=xdgdesktopportal
fi
exec "$prefix/bin/gtld-analyzer" "$@"
