From 663408f5296d6c7385cd12dca55952e03aeb9009 Mon Sep 17 00:00:00 2001 From: amgg <2adrian2@gmail.com> Date: Sat, 31 Jan 2026 01:23:14 -0800 Subject: [PATCH] various windows build fixes/improvements - switch Configure helper function to use a list of args instead of a single string, so that paths with spaces won't break it (?probably at least, I didn't actually have any spaces in the paths of mine so it didn't actually matter in the end) - move `breeze-icons` build to above `kiconthemes`, since build for the latter will fail if the former isn't there yet - skip re-downloading zips if they've already been downloaded (same as how cloning of git repos was already handled) - added one stray include that was missing - change copied dll name from zlibd.dll to zd.dll - add copying of qsqlited.dll which is required for DataExplorer --- parts/scene/animation.cpp | 2 ++ scripts/windows-build.ps1 | 6 ++++- scripts/windows-setup.ps1 | 51 ++++++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/parts/scene/animation.cpp b/parts/scene/animation.cpp index 413951da..fb608652 100644 --- a/parts/scene/animation.cpp +++ b/parts/scene/animation.cpp @@ -1,6 +1,8 @@ // SPDX-FileCopyrightText: 2026 Joshua Goins // SPDX-License-Identifier: GPL-3.0-or-later +#include + #include "animation.h" #include "scenestate.h" diff --git a/scripts/windows-build.ps1 b/scripts/windows-build.ps1 index 7b7adfb2..2efefca4 100644 --- a/scripts/windows-build.ps1 +++ b/scripts/windows-build.ps1 @@ -18,5 +18,9 @@ Copy-Item -Path "$PrefixDir/bin/KF6ColorScheme.dll" -Destination "$BuildDir/bin" Copy-Item -Path "$PrefixDir/bin/intl-8.dll" -Destination "$BuildDir/bin" Copy-Item -Path "$PrefixDir/bin/KF6IconThemes.dll" -Destination "$BuildDir/bin" Copy-Item -Path "$PrefixDir/bin/iconv.dll" -Destination "$BuildDir/bin" -Copy-Item -Path "$PrefixDir/bin/zlibd.dll" -Destination "$BuildDir/bin" +Copy-Item -Path "$PrefixDir/bin/zd.dll" -Destination "$BuildDir/bin" Copy-Item -Path "$env:QTDIR/bin/Qt6PrintSupportd.dll" -Destination "$BuildDir/bin" +if (!(Test-Path "$BuildDir/plugins/sqldrivers")) { + New-Item -ItemType Directory -Path "$BuildDir/plugins/sqldrivers" +} +Copy-Item -Path "$env:QTDIR/plugins/sqldrivers/qsqlited.dll" -Destination "$BuildDir/plugins/sqldrivers" diff --git a/scripts/windows-setup.ps1 b/scripts/windows-setup.ps1 index 6f740a91..c3e0b5c5 100644 --- a/scripts/windows-setup.ps1 +++ b/scripts/windows-setup.ps1 @@ -10,10 +10,15 @@ $PrefixDir = (Get-Location).Path + "/prefix" $NumCores = [Environment]::ProcessorCount -function Configure($Name, $ExtraArgs = "") { - $Command = "cmake -B $BuildDir-$Name -DCMAKE_PREFIX_PATH=$PrefixDir -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Debug -S $LocalDir/$Name -DCMAKE_INSTALL_PREFIX=$PrefixDir $ExtraArgs" - Write-Output "Running $Command" - Invoke-Expression $Command +function Configure { + param( + [string]$Name, + [Parameter(ValueFromRemainingArguments=$true)] + [string[]]$ExtraArgs + ) + $Arguments = @("-B", "$BuildDir-$Name", "-DCMAKE_PREFIX_PATH=$PrefixDir", "-DCMAKE_CXX_COMPILER=cl", "-DCMAKE_C_COMPILER=cl", "-DCMAKE_BUILD_TYPE=Debug", "-S", "$LocalDir/$Name", "-DCMAKE_INSTALL_PREFIX=$PrefixDir"; $ExtraArgs) + Write-Output "Running cmake $Arguments" + & { cmake @Arguments } if ($LASTEXITCODE -ne 0) { throw "Failed to configure $Name" } @@ -37,21 +42,29 @@ function CheckCompileResult($Name) { } } +function Download($Url, $FileName) { + if (Test-Path "$LocalDir/$FileName") { + Write-Information "Skipping download of $FileName because it's source directory already exists" + } else { + Invoke-WebRequest $Url -OutFile "$LocalDir/$FileName" + } +} + if (!(Test-Path $LocalDir)) { New-Item -ItemType Directory -Path $LocalDir } # Setup Windows dependencies -Invoke-WebRequest https://xiv.zone/distrib/dependencies/gettext.zip -OutFile "$LocalDir/gettext.zip" +Download https://xiv.zone/distrib/dependencies/gettext.zip "gettext.zip" Expand-Archive -Path "$LocalDir/gettext.zip" -DestinationPath $PrefixDir -Force -Invoke-WebRequest https://xiv.zone/distrib/dependencies/iconv.zip -OutFile "$LocalDir/iconv.zip" +Download https://xiv.zone/distrib/dependencies/iconv.zip "iconv.zip" Expand-Archive -Path "$LocalDir/iconv.zip" -DestinationPath $PrefixDir -Force -Invoke-WebRequest https://cfhcable.dl.sourceforge.net/project/gnuwin32/gperf/3.0.1/gperf-3.0.1-bin.zip -OutFile "$LocalDir/gperf.zip" +Download https://cfhcable.dl.sourceforge.net/project/gnuwin32/gperf/3.0.1/gperf-3.0.1-bin.zip "gperf.zip" Expand-Archive -Path "$LocalDir/gperf.zip" -DestinationPath $PrefixDir -Force -Invoke-WebRequest https://xiv.zone/distrib/dependencies/icoutils.zip -OutFile "$LocalDir/icoutils.zip" +Download https://xiv.zone/distrib/dependencies/icoutils.zip "icoutils.zip" Expand-Archive -Path "$LocalDir/icoutils.zip" -DestinationPath $PrefixDir -Force # Build zlib @@ -90,7 +103,7 @@ CheckCompileResult "kconfig" # Build KArchive Clone "karchive" "https://invent.kde.org/frameworks/karchive.git" -Configure "karchive" "-DBUILD_TESTING=OFF -DWITH_BZIP2=OFF -DWITH_LIBLZMA=OFF -DWITH_LIBZSTD=OFF" +Configure "karchive" "-DBUILD_TESTING=OFF" "-DWITH_BZIP2=OFF" "-DWITH_LIBLZMA=OFF" "-DWITH_LIBZSTD=OFF" cmake --build "$BuildDir-karchive" --config Debug --target install --parallel $NumCores CheckCompileResult "karchive" @@ -132,6 +145,14 @@ Configure "kconfigwidgets" "-DBUILD_TESTING=OFF" cmake --build "$BuildDir-kconfigwidgets" --config Debug --target install --parallel $NumCores CheckCompileResult "kconfigwidgets" +# Build breeze icons +Clone "breeze-icons" "https://invent.kde.org/frameworks/breeze-icons.git" +Configure "breeze-icons" "-DICONS_LIBRARY=ON" "-DSKIP_INSTALL_ICONS=ON" +# Building it twice is intentional, the first time will always fail +cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores +cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores +CheckCompileResult "breeze-icons" + # Build KIconThemes Clone "kiconthemes" "https://invent.kde.org/frameworks/kiconthemes.git" Configure "kiconthemes" "-DBUILD_TESTING=OFF" @@ -152,13 +173,13 @@ CheckCompileResult "kcompletion" # Build KTextWidgets Clone "ktextwidgets" "https://invent.kde.org/frameworks/ktextwidgets.git" -Configure "ktextwidgets" "-DBUILD_TESTING=OFF -DWITH_TEXT_TO_SPEECH=OFF" +Configure "ktextwidgets" "-DBUILD_TESTING=OFF" "-DWITH_TEXT_TO_SPEECH=OFF" cmake --build "$BuildDir-ktextwidgets" --config Debug --target install --parallel $NumCores CheckCompileResult "ktextwidgets" # Build KXmlGui Clone "kxmlgui" "https://invent.kde.org/frameworks/kxmlgui.git" -Configure "kxmlgui" "-DBUILD_TESTING=OFF -DFORCE_DISABLE_KGLOBALACCEL=ON" +Configure "kxmlgui" "-DBUILD_TESTING=OFF" "-DFORCE_DISABLE_KGLOBALACCEL=ON" cmake --build "$BuildDir-kxmlgui" --config Debug --target install --parallel $NumCores CheckCompileResult "kxmlgui" @@ -196,11 +217,3 @@ Clone "SPIRV-Headers" "https://github.com/KhronosGroup/SPIRV-Headers.git" Configure "SPIRV-Headers" cmake --build "$BuildDir-SPIRV-Headers" --config Debug --target install --parallel $NumCores CheckCompileResult "SPIRV-Headers" - -# Build breeze icons -Clone "breeze-icons" "https://invent.kde.org/frameworks/breeze-icons.git" -Configure "breeze-icons" "-DICONS_LIBRARY=ON -DSKIP_INSTALL_ICONS=ON" -# Building it twice is intentional, the first time will always fail -cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores -cmake --build "$BuildDir-breeze-icons" --config Debug --target install --parallel $NumCores -CheckCompileResult "breeze-icons"