gencpp/scripts/build.ci.ps1

46 lines
887 B
PowerShell
Raw Normal View History

2023-04-01 19:21:46 -07:00
[string] $type = $null
[string] $test = $false
foreach ( $arg in $args )
{
if ( $arg -eq "test" )
{
$test = $true
}
else
2023-04-01 19:21:46 -07:00
{
$type = $arg
}
}
$path_root = git rev-parse --show-toplevel
$path_build = Join-Path $path_root build
$path_scripts = Join-Path $path_root scripts
$path_test = Join-Path $path_root test
$path_gen = Join-Path $path_test gen
$path_test_build = Join-Path $path_test build
$path_gen_build = Join-Path $path_gen build
2023-04-01 19:21:46 -07:00
write-host "`n`nBuilding Test`n"
2023-04-01 19:21:46 -07:00
if ( -not( Test-Path $path_gen_build ) )
{
# Generate build files for meta-program
Push-Location $path_gen
$args_meson = @()
$args_meson += "setup"
$args_meson += $path_gen_build
& meson $args_meson
Pop-Location
}
2023-04-01 19:21:46 -07:00
# Compile meta-program
Push-Location $path_root
2023-04-01 19:21:46 -07:00
$args_ninja = @()
$args_ninja += "-C"
$args_ninja += $path_gen_build
& ninja $args_ninja
Pop-Location