mirror of
https://github.com/glfw/glfw.git
synced 2025-06-08 00:34:56 +00:00
add build script
This commit is contained in:
parent
1b862baaa3
commit
6b9873c31e
67
make.ps1
Normal file
67
make.ps1
Normal file
@ -0,0 +1,67 @@
|
||||
param (
|
||||
[string]$arch = 'x64'
|
||||
)
|
||||
|
||||
$buildArch = 'x64'
|
||||
|
||||
# only x86 / x64 is supported
|
||||
if(-NOT (($arch -eq 'x64') -or ($arch -eq 'x86'))) {
|
||||
Write-Host "Invalid argument '$arch' - only 'x86' and 'x64' is supported"
|
||||
return
|
||||
}
|
||||
|
||||
if($arch -eq 'x86') {
|
||||
$buildArch = 'Win32'
|
||||
}
|
||||
|
||||
$buildPath = "./build/win-$arch"
|
||||
|
||||
Write-Host "##################################################################"
|
||||
Write-Host "glfw build script"
|
||||
Write-Host "##################################################################"
|
||||
Write-Host ""
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host "### configuration"
|
||||
Write-Host "-----------------------------"
|
||||
|
||||
Write-Host "arch: $arch"
|
||||
Write-Host "path: $buildPath"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host "### preparation:"
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host ""
|
||||
|
||||
if (Test-Path $buildPath) {
|
||||
Get-ChildItem -Path $buildPath -Recurse | Remove-Item -force -recurse
|
||||
Remove-Item $buildPath -force
|
||||
Write-Host "deleted build folder"
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
New-Item -ItemType directory -Path $buildPath | Out-Null
|
||||
Write-Host "created build folder"
|
||||
Write-Host ""
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host "### cmake - preparing build"
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host ""
|
||||
|
||||
cmake -S . -B $buildPath -A $buildArch -D BUILD_SHARED_LIBS=ON
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host "### cmake - building $arch"
|
||||
Write-Host "-----------------------------"
|
||||
Write-Host ""
|
||||
|
||||
cd $buildPath
|
||||
cmake --build . --config Release
|
||||
|
||||
cd ..\..
|
||||
Write-Host ""
|
||||
Write-Host "-----------------------------"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user