added a windows build script and updated the README.md for proper markdown formatting

This commit is contained in:
Lew
2026-10-19 19:16:59 -04:00
parent f4916f76a2
commit c46487ac7c
2 changed files with 85 additions and 15 deletions
+40
View File
@@ -0,0 +1,40 @@
param(
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Release",
[string]$BuildDirectory = "build"
)
$ErrorActionPreference = "Stop"
if (-not (Get-Command cmake -ErrorAction SilentlyContinue)) {
Write-Error "CMake was not found. Install CMake and ensure it is on PATH."
exit 1
}
$sourceDirectory = Split-Path -Parent $PSScriptRoot
if ([System.IO.Path]::IsPathRooted($BuildDirectory)) {
$buildPath = $BuildDirectory
} else {
$buildPath = Join-Path $sourceDirectory $BuildDirectory
}
$configureArgs = @(
"-S", $sourceDirectory,
"-B", $buildPath,
"-G", "Ninja",
"-DCMAKE_CXX_COMPILER=g++",
"-DCMAKE_BUILD_TYPE=$Configuration"
)
& cmake @configureArgs
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
& cmake --build $buildPath --config $Configuration
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
$outputPath = Join-Path $buildPath "bin\$($Configuration.ToLowerInvariant())\LumberJack.exe"
Write-Host "Build complete: $outputPath"