Make build.FullCLR.ps1 script more user friendly:

error messages + -G parameter support for cmake
This commit is contained in:
Sergei Vorobev 2016-02-03 15:41:11 -08:00
parent f7559991ce
commit e87aac7046

View file

@ -1,6 +1,42 @@
param(
[ValidateSet(
"",
"Visual Studio 12 2013",
"Visual Studio 12 2013 Win64",
"Visual Studio 14 2015",
"Visual Studio 14 2015 Win64")]
[string]$cmakeGenerator = ""
)
$origPWD = $pwd
try
{
$prechecks = $true
# check per-requests
if (-not (get-command cmake -ErrorAction SilentlyContinue))
{
Write-Warning 'cmake not found. You can install it from https://chocolatey.org/packages/cmake.portable'
$prechecks = $false
}
if (-not (get-command msbuild -ErrorAction SilentlyContinue))
{
Write-Warning 'msbuild not found. Install Visual Studio and add msbuild to $env:PATH'
$prechecks = $false
}
if (-not (get-command dotnet -ErrorAction SilentlyContinue))
{
Write-Warning 'dotnet not found. Install it from http://dotnet.github.io/getting-started/'
$prechecks = $false
}
if (-not $prechecks)
{
return
}
# end per-requests
$BINFULL = "$pwd/binFull"
$BUILD = "$pwd/build"
@ -23,7 +59,14 @@ try
mkdir $build -ErrorAction SilentlyContinue
cd $build
cmake ..\src\powershell-native
if ($cmakeGenerator)
{
cmake -G "$cmakeGenerator" ..\src\powershell-native
}
else
{
cmake ..\src\powershell-native
}
msbuild powershell.sln
cp -rec Debug\* $BINFULL