-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
27 lines (19 loc) · 1.09 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
$versions = Get-Content (Resolve-Path ".\versions").Path | Select-Object -First 2
$TOOL_VERSION = $versions[0]
$API_VERSION = $versions[1]
$CXX_FLAGS = @("-DPLATFORM_WIN32", "-DCPU_ARCH_X64", "-DTOOL_VERSION=$TOOL_VERSION", "-DAPI_VERSION=$API_VERSION", "-DDEV_BUILD", "-I..", "-I../libs/anyfin", "-std=c++2b", "-O0", "-g", "-gcodeview", "-march=native", "-masm=intel", "-fno-exceptions", "-fdiagnostics-absolute-paths", "-Wno-switch", "-Wno-deprecated-declarations", "-Wno-inconsistent-dllimport", "-nostdlib", "-nostdlib++")
if (!(Test-Path -Path ".\out")) {
New-Item -ItemType Directory -Path ".\out" | Out-Null
}
Push-Location .\out
$compile_time = Measure-Command {
Get-ChildItem -Path "..\code" -Filter "*.cpp" | ForEach-Object -Parallel {
& clang++ $using:CXX_FLAGS -c $_.FullName
}
}
Write-Host ("Compile: {0,10:F6} seconds" -f $compile_time.TotalSeconds)
$link_time = Measure-Command {
& lld-link /def:..\cbuild.def *.o kernel32.lib shell32.lib Advapi32.lib /out:cbuild.exe /debug:full /subsystem:console
}
Write-Host ("Link: {0,13:F6} seconds" -f $link_time.TotalSeconds)
Pop-Location