Skip to content

Commit a687558

Browse files
committed
build.ps1 - Add a very quick set of checks to determine if VS common tools environment variable is null
Code repetition should be improved at a later point
1 parent ebbf10f commit a687558

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#requires -Version 3
1+
#requires -Version 5
22

33
param(
44
[ValidateSet("vs2012", "vs2013", "vs2015", "vs2017", "nupkg", "nupkg-only")]
@@ -224,18 +224,30 @@ try
224224
{
225225
'v110'
226226
{
227+
if($env:VS110COMNTOOLS -eq $null)
228+
{
229+
Die "Visual Studio 2012 was not found"
230+
}
227231
$VisualStudioVersion = '11.0'
228232
$VXXCommonTools = Join-Path $env:VS110COMNTOOLS '..\..\vc'
229233
$CmakeGenerator = 'Visual Studio 11'
230234
}
231235
'v120'
232236
{
237+
if($env:VS120COMNTOOLS -eq $null)
238+
{
239+
Die "Visual Studio 2013 was not found"
240+
}
233241
$VisualStudioVersion = '12.0'
234242
$VXXCommonTools = Join-Path $env:VS120COMNTOOLS '..\..\vc'
235243
$CmakeGenerator = 'Visual Studio 12'
236244
}
237245
'v140'
238246
{
247+
if($env:VS140COMNTOOLS -eq $null)
248+
{
249+
Die "Visual Studio 2015 was not found"
250+
}
239251
$VisualStudioVersion = '14.0'
240252
$VXXCommonTools = Join-Path $env:VS140COMNTOOLS '..\..\vc'
241253
$CmakeGenerator = 'Visual Studio 14'

0 commit comments

Comments
 (0)