-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add applicaton icon for Windows build #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
de6f406
2bd2485
db34945
24eb946
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,13 +4,61 @@ param ( | |||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if ($IsWindows) { | ||||||||||||||||||||||||||
| cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build | ||||||||||||||||||||||||||
| cmake --build build --config Release --parallel 32 | ||||||||||||||||||||||||||
| # Check if Ninja is installed | ||||||||||||||||||||||||||
| if (-not (Get-Command ninja -ErrorAction SilentlyContinue)) { | ||||||||||||||||||||||||||
| Write-Error "Ninja build system is not installed. Please install Ninja." | ||||||||||||||||||||||||||
| Write-Error "Install via: choco install ninja (or download from https://github.com/ninja-build/ninja/releases)" | ||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Check if Visual Studio is installed (including preview versions) for compiler | ||||||||||||||||||||||||||
| $vsPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -property installationPath 2>$null | ||||||||||||||||||||||||||
| if (-not $vsPath) { | ||||||||||||||||||||||||||
| Write-Error "Visual Studio is not installed. Please install Visual Studio 2022 with C++ development tools." | ||||||||||||||||||||||||||
| Write-Error "Download from: https://visualstudio.microsoft.com/downloads/" | ||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Write-Host "Using Visual Studio at: $vsPath" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Use Ninja generator | ||||||||||||||||||||||||||
| $generator = "Ninja" | ||||||||||||||||||||||||||
| Write-Host "Using CMake generator: $generator" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Check if Qt is installed | ||||||||||||||||||||||||||
| if (-not (Test-Path "C:\Qt\6.9.0\msvc2022_64")) { | ||||||||||||||||||||||||||
| Write-Error "Qt 6.9.0 MSVC2022 64-bit is not installed at C:\Qt\6.9.0\msvc2022_64" | ||||||||||||||||||||||||||
| Write-Error "Please install Qt 6.9.0 for MSVC 2022 64-bit from: https://www.qt.io/download" | ||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Find vcvars64.bat to setup Visual Studio environment | ||||||||||||||||||||||||||
| $vcvars = "$vsPath\VC\Auxiliary\Build\vcvars64.bat" | ||||||||||||||||||||||||||
| if (-not (Test-Path $vcvars)) { | ||||||||||||||||||||||||||
| Write-Error "Visual Studio C++ tools not found. Please install C++ development workload." | ||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Setup Visual Studio environment and run CMake with Ninja generator | ||||||||||||||||||||||||||
| & cmd /c "`"$vcvars`" && cmake . -G `"$generator`" -DCMAKE_PREFIX_PATH=C:\Qt\6.9.0\msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=`"/Zc:__cplusplus /permissive-`" -DCMAKE_BUILD_TYPE=Release -B build" | ||||||||||||||||||||||||||
| if ($LASTEXITCODE -ne 0) { | ||||||||||||||||||||||||||
| Write-Error "CMake configuration failed" | ||||||||||||||||||||||||||
| exit $LASTEXITCODE | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| & cmd /c "`"$vcvars`" && cmake --build build --parallel 32" | ||||||||||||||||||||||||||
| if ($LASTEXITCODE -ne 0) { | ||||||||||||||||||||||||||
| Write-Error "Build failed" | ||||||||||||||||||||||||||
| exit $LASTEXITCODE | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| if ($Package) { | ||||||||||||||||||||||||||
| mkdir .\build\Release | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| mkdir .\build\Release | |
| mkdir .\build\Release -Force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add error handling and safe directory creation.
The packaging steps lack error handling and may fail if the directory already exists.
Apply this diff to improve robustness:
- mkdir .\build\Release
+ if (-not (Test-Path .\build\Release)) {
+ New-Item -ItemType Directory -Path .\build\Release -Force | Out-Null
+ }
+
+ if (-not (Test-Path .\build\SQLiteQueryAnalyzer.exe)) {
+ Write-Error "Build output not found: .\build\SQLiteQueryAnalyzer.exe"
+ exit 1
+ }
+
Copy-Item .\build\SQLiteQueryAnalyzer.exe .\build\Release\SQLiteQueryAnalyzer.exe📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| mkdir .\build\Release | |
| Copy-Item .\build\SQLiteQueryAnalyzer.exe .\build\Release\SQLiteQueryAnalyzer.exe | |
| if (-not (Test-Path .\build\Release)) { | |
| New-Item -ItemType Directory -Path .\build\Release -Force | Out-Null | |
| } | |
| if (-not (Test-Path .\build\SQLiteQueryAnalyzer.exe)) { | |
| Write-Error "Build output not found: .\build\SQLiteQueryAnalyzer.exe" | |
| exit 1 | |
| } | |
| Copy-Item .\build\SQLiteQueryAnalyzer.exe .\build\Release\SQLiteQueryAnalyzer.exe |
🤖 Prompt for AI Agents
In src/project/build.ps1 around lines 56 to 57, the script unconditionally calls
mkdir and Copy-Item which will fail if the directory already exists or if copy
errors occur; update to create the Release folder safely (use Test-Path or
New-Item -ItemType Directory -Force) and wrap the directory creation and
Copy-Item in a try/catch with -ErrorAction Stop so failures are caught; on
error, write a clear error message to stderr (Write-Error or Write-Host with
red) and exit with a non-zero code to fail the build.
Uh oh!
There was an error while loading. Please reload this page.