-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
executable file
·43 lines (38 loc) · 1.17 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pushd sqlite3
.\build.ps1
if ($LastExitCode -ne 0) {
exit 1
}
popd
$config = "debug"
$platform = "windows"
$arch = "x86_64"
$sourceDir = "src"
$mainSource = "$sourceDir\firemark\app.d"
$outputDir = "bin\$config-$platform-$arch"
$outputFile = "$outputDir\firemark.exe"
$libDir = "lib\$config-$platform-$arch"
$outdated = $false
if (Test-Path -Path $outputFile -PathType Leaf) {
$outputFile = Get-Item -Path $outputFile
$thisPath = Get-Item -Path $MyInvocation.MyCommand.Path
if ($thisPath.LastWriteTime -gt $outputFile.LastWriteTime) {
$outdated = $true
}
else {
$files = Get-ChildItem -Recurse -Path $sourceDir
foreach ($file in $files) {
if ($file.LastWriteTime -gt $outputFile.LastWriteTime) {
$outdated = $true
break
}
}
}
}
else {
$outdated = $true
}
if ($outdated) {
dmd -i -g -debug -m64 -w -vcolumns -preview=dip1000 -preview=dip1008 -preview=fieldwise -preview=fixAliasThis -preview=rvaluerefparam -preview=inclusiveincontracts (Get-ChildItem "$libDir" -Filter "*.lib").FullName "sqlite3\sqlite3.obj" -J"$sourceDir" -I"$sourceDir" "$mainSource" -of"$outputFile"
Copy-Item (Get-ChildItem "$libDir" -Filter "*.dll").FullName -Destination "$outputDir"
}