basic incremental build

This commit is contained in:
2026-07-23 13:00:01 -04:00
parent b17960b0e4
commit 315f3d5163
5 changed files with 424 additions and 146 deletions
+29
View File
@@ -0,0 +1,29 @@
# check_target.ps1 - Checks if target binary needs to be rebuilt based on binary existence and source file modification times
param(
[string]$TargetBinary,
[string]$SearchDirs
)
if (-not (Test-Path $TargetBinary)) {
Set-Content -Path "Intermediate\need_build.tmp" -Value "1"
exit 0
}
$binTime = (Get-Item $TargetBinary).LastWriteTime
$dirs = $SearchDirs -split ','
$needsRebuild = "0"
foreach ($dir in $dirs) {
if (Test-Path $dir) {
# Check source .cpp, .h, .hpp, .inl files for changes newer than target binary
$newer = Get-ChildItem -Path $dir -Recurse -File -ErrorAction SilentlyContinue | Where-Object {
($_.Extension -eq '.cpp' -or $_.Extension -eq '.h' -or $_.Extension -eq '.hpp' -or $_.Extension -eq '.inl') -and $_.LastWriteTime -gt $binTime
}
if ($newer) {
$needsRebuild = "1"
break
}
}
}
Set-Content -Path "Intermediate\need_build.tmp" -Value $needsRebuild