Qt: Add GammaRay build scripts

This commit is contained in:
chaoticgd 2025-03-22 00:40:02 +00:00 committed by Ty
parent 1b4ced3e55
commit 8a1f2a151d
3 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -e
if [ "$#" -ne 2 ]; then
echo "Syntax: $0 <deps directory> <output directory>"
exit 1
fi
DEPSDIR=$(realpath "$1")
INSTALLDIR=$(realpath "$2")
if [ ! -d "$DEPSDIR/include/QtCore" ]; then
echo "Error: The build-dependencies-qt.sh script must be run on the deps directory first."
exit 1
fi
GAMMARAY=master
mkdir -p gammaray-build
cd gammaray-build
echo "Downloading..."
curl -L -o "GammaRay-$GAMMARAY.tar.gz" https://github.com/KDAB/GammaRay/archive/$GAMMARAY.tar.gz
rm -fr "GammaRay-$GAMMARAY"
echo "Extracting..."
tar xf "GammaRay-$GAMMARAY.tar.gz"
cd "GammaRay-$GAMMARAY"
mkdir build
cd build
echo "Configuring..."
cmake -DCMAKE_PREFIX_PATH="$DEPSDIR" -G Ninja -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DGAMMARAY_BUILD_DOCS=false ..
echo "Building..."
cmake --build . --parallel
echo "Installing..."
cmake --build . --target install
cd ../..
echo "Cleaning up..."
cd ..
rm -r gammaray-build

View File

@ -0,0 +1,68 @@
@echo off
setlocal enabledelayedexpansion
echo Setting environment...
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
) else if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
) else (
echo Visual Studio 2022 not found.
goto error
)
pushd %~dp0
cd ..\..\..\..
cd deps || goto error
set "DEPSDIR=%CD%"
cd ..
mkdir gammaray
cd gammaray || goto error
set "INSTALLDIR=%CD%"
cd ..
mkdir gammaray-build
cd gammaray-build || goto error
set "BUILDDIR=%CD%"
echo DEPSDIR=%DEPSDIR%
echo BUILDDIR=%BUILDDIR%
echo INSTALLDIR=%INSTALLDIR%
set GAMMARAY="master"
echo Downloading...
curl -L -o "GammaRay-%GAMMARAY%.tar.gz" "https://github.com/KDAB/GammaRay/archive/%GAMMARAY%.tar.gz" || goto error
rmdir /s /q "GammaRay-%GAMMARAY%"
echo Extracting...
tar -xf "GammaRay-%GAMMARAY%.tar.gz" || goto error
echo Configuring...
cmake "GammaRay-%GAMMARAY%" -B build -DCMAKE_PREFIX_PATH="%DEPSDIR%" -G Ninja -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" -DGAMMARAY_BUILD_DOCS=false || goto error
echo Building...
cmake --build build --parallel || goto error
echo Installing...
cmake --build build --target install || goto errorlevel
echo Copying DLLs...
xcopy /y "%DEPSDIR%\bin\*.dll" "%INSTALLDIR%\bin\"
xcopy /y /e /s "%DEPSDIR%\plugins" "%INSTALLDIR%\bin\"
echo Cleaning up...
cd ..
rd /s /q gammaray-build
echo Exiting with success.
popd
pause
exit 0
:error
echo Failed with error #%errorlevel%.
popd
pause
exit %errorlevel%

2
.gitignore vendored
View File

@ -109,6 +109,8 @@ oprofile_data/
/deps-build
/deps
/deps-arm64
/gammaray-build
/gammaray
/ipch
!/3rdparty/libjpeg/change.log