mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
* Updated Dependencies Script * demo * fix submodule hell!!! * lol * attmept 2 * install nasm in ci * setup sh 1 * yeah * better zlib building * codegen stuff * attempt 2 at bun codegen ci * o * deps improvements * generaet part of compile-cpp-only.ps1 * restore these * good enough for Unix * remove libuv submodule lol * pass over docs
41 lines
1.2 KiB
PowerShell
41 lines
1.2 KiB
PowerShell
$ErrorActionPreference = 'Stop' # Setting strict mode, similar to 'set -euo pipefail' in bash
|
|
. (Join-Path $PSScriptRoot "env.ps1")
|
|
$CWD = Get-Location
|
|
|
|
$Source = (Join-Path $PSScriptRoot "../src/deps/libuv")
|
|
$Commit = "da527d8d2a908b824def74382761566371439003"
|
|
|
|
if (!(Test-Path -PathType Container $Source)) {
|
|
Write-Host "Cloning libuv: $Commit"
|
|
New-Item -ItemType Directory -Force -Path $Source
|
|
Push-Location $Source
|
|
try {
|
|
Run git init
|
|
Run git remote add origin "https://github.com/libuv/libuv"
|
|
Run git fetch --depth 1 origin $Commit
|
|
Run git checkout FETCH_HEAD
|
|
} finally { Pop-Location }
|
|
} else {
|
|
Push-Location $Source
|
|
try {
|
|
$CurrentCommit = git rev-parse HEAD
|
|
if ($CurrentCommit -ne $Commit) {
|
|
Write-Host "Updating libuv: $Commit"
|
|
Run git fetch --depth 1 origin $Commit
|
|
Run git checkout FETCH_HEAD
|
|
}
|
|
} finally { Pop-Location }
|
|
}
|
|
|
|
Push-Location $Source
|
|
try {
|
|
$null = mkdir build -ErrorAction SilentlyContinue
|
|
Set-Location build
|
|
|
|
Run cmake .. @CMAKE_FLAGS "-DCMAKE_C_FLAGS=/DWIN32 /D_WINDOWS -Wno-int-conversion"
|
|
Run cmake --build . --clean-first --config Release
|
|
|
|
Copy-Item libuv.lib $BUN_DEPS_OUT_DIR
|
|
Write-Host "-> libuv.lib"
|
|
} finally { Pop-Location }
|