-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBuild-LuaJIT.ps1
More file actions
29 lines (27 loc) · 926 Bytes
/
Build-LuaJIT.ps1
File metadata and controls
29 lines (27 loc) · 926 Bytes
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
$ErrorActionPreference = 'Stop'
# https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
function Start-VsDevCmd
{
$installationPath = (
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
-prerelease -latest -property installationPath)
$vsdevcmd = Join-Path `
-Path "$installationPath" `
-ChildPath Common7\Tools\VsDevCmd.bat `
-Resolve
& "${env:COMSPEC}" /s /c "`"$vsdevcmd`" -no_logo -arch=amd64 && set" |
ForEach-Object {
$name, $value = $_ -split '=', 2
Set-Item -Path env:\"$name" -Value $value
}
}
if (-Not (Get-Command "cl" -ErrorAction "SilentlyContinue"))
{
Start-VsDevCmd
}
if (Test-Path -Path build -PathType Container)
{
Remove-Item -Recurse -Force -Path build
}
cmake -B build -G Ninja -D CMAKE_C_COMPILER=cl
cmake --build build --target package