mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
29 lines
937 B
PowerShell
Executable File
29 lines
937 B
PowerShell
Executable File
param (
|
|
[switch] $Baseline = $False,
|
|
[switch] $Fast = $False
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop' # Setting strict mode, similar to 'set -euo pipefail' in bash
|
|
|
|
$Tag = If ($Baseline) { "-Baseline" } Else { "" }
|
|
$UseBaselineBuild = If ($Baseline) { "ON" } Else { "OFF" }
|
|
$UseLto = If ($Fast) { "OFF" } Else { "ON" }
|
|
|
|
# $CANARY_REVISION = if (Test-Path build/.canary_revision) { Get-Content build/.canary_revision } else { "0" }
|
|
$CANARY_REVISION = 0
|
|
.\scripts\env.ps1 $Tag
|
|
.\scripts\update-submodules.ps1
|
|
.\scripts\build-libuv.ps1 -CloneOnly $True
|
|
cd build
|
|
|
|
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release `
|
|
-DNO_CODEGEN=1 `
|
|
-DNO_CONFIGURE_DEPENDS=1 `
|
|
"-DUSE_BASELINE_BUILD=${UseBaselineBuild}" `
|
|
"-DUSE_LTO=${UseLto}" `
|
|
"-DCANARY=${CANARY_REVISION}" `
|
|
-DBUN_CPP_ONLY=1 $Flags
|
|
if ($LASTEXITCODE -ne 0) { throw "CMake configuration failed" }
|
|
|
|
.\compile-cpp-only.ps1 -v
|
|
if ($LASTEXITCODE -ne 0) { throw "C++ compilation failed" } |