added a windows build script and updated the README.md for proper markdown formatting
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user