-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-dist.ps1
35 lines (27 loc) · 896 Bytes
/
build-dist.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
$root = "$PSScriptRoot\dist\share\nitro"
# linux stubs
New-Item -ItemType Directory -Path "$root\stub\linux-gnu-x86_64" -Force
.\lib\llvm\bin\llvm-ifs.exe `
--output-elf="$root\stub\linux-gnu-x86_64\libc.so" `
--arch=x86_64 --bitwidth=64 --endianness=little `
"$PSScriptRoot\stub\linux-gnu\libc.ifs"
if ($LASTEXITCODE -ne 0) {
exit 1
}
# darwin stubs
New-Item -ItemType Directory -Path "$root\stub\darwin" -Force
Copy-Item "$PSScriptRoot\stub\darwin\libSystem.tbd" -Destination "$root\stub\darwin"
# win32 stubs
New-Item -ItemType Directory -Path "$root\stub\win32-x86_64" -Force
./lib/llvm/bin/llvm-lib.exe `
/def:"$PSScriptRoot\stub\win32\msvcrt.def" `
/machine:x64 `
/out:"$root\stub\win32-x86_64\msvcrt.lib"
if ($LASTEXITCODE -ne 0) {
exit 1
}
# std
.\dist\bin\nitro.exe pack --output dist\share\nitro\nitro.npk
if ($LASTEXITCODE -ne 0) {
exit 1
}