From a8c9f86f85b3450bb41644a6a8f23422cba4758d Mon Sep 17 00:00:00 2001 From: Kirk Munro Date: Tue, 4 Jul 2017 22:36:01 -0300 Subject: [PATCH 1/3] added requirement check for atlbase.h --- build.psm1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 364fea38c58..61e62829590 100644 --- a/build.psm1 +++ b/build.psm1 @@ -222,11 +222,20 @@ Fix steps: throw 'Win 10 SDK not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk' } - $vcVarsPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName + # atlbase.h is included in at least one project + $vcPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName + $atlMfcIncludePath = Join-Path -Path $vcPath -ChildPath 'atlmfc/include' + if ((Test-Path -Path $atlMfcIncludePath\atlbase.h) -eq $false) { + throw "Could not find Visual Studio include file atlbase.h at $atlMfcIncludePath. Please ensure the optional feature 'Microsoft Foundation Classes for C++' is installed." + } + + # vcvarsall.bat is used to setup environment variables + $vcVarsPath = $vcPath if ((Test-Path -Path $vcVarsPath\vcvarsall.bat) -eq $false) { throw "Could not find Visual Studio vcvarsall.bat at $vcVarsPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed." } + # setup msbuild configuration if ($Configuration -eq 'Debug' -or $Configuration -eq 'Release') { $msbuildConfiguration = $Configuration From ac1f65ddc09c5682cd32dd50084458a677e434e3 Mon Sep 17 00:00:00 2001 From: Kirk Munro Date: Tue, 4 Jul 2017 22:38:22 -0300 Subject: [PATCH 2/3] removed blank line mistakenly added --- build.psm1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 61e62829590..306e646dd62 100644 --- a/build.psm1 +++ b/build.psm1 @@ -235,7 +235,6 @@ Fix steps: throw "Could not find Visual Studio vcvarsall.bat at $vcVarsPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed." } - # setup msbuild configuration if ($Configuration -eq 'Debug' -or $Configuration -eq 'Release') { $msbuildConfiguration = $Configuration From 54464bead65c4ac2d521fbe42f6a0bbbc4374072 Mon Sep 17 00:00:00 2001 From: Kirk Munro Date: Mon, 17 Jul 2017 13:43:39 -0300 Subject: [PATCH 3/3] updated based on pull request feedback --- build.psm1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.psm1 b/build.psm1 index 306e646dd62..ecf8848a01e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -222,17 +222,17 @@ Fix steps: throw 'Win 10 SDK not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk' } - # atlbase.h is included in at least one project $vcPath = (Get-Item(Join-Path -Path "$env:VS140COMNTOOLS" -ChildPath '../../vc')).FullName $atlMfcIncludePath = Join-Path -Path $vcPath -ChildPath 'atlmfc/include' + + # atlbase.h is included in the pwrshplugin project if ((Test-Path -Path $atlMfcIncludePath\atlbase.h) -eq $false) { throw "Could not find Visual Studio include file atlbase.h at $atlMfcIncludePath. Please ensure the optional feature 'Microsoft Foundation Classes for C++' is installed." } # vcvarsall.bat is used to setup environment variables - $vcVarsPath = $vcPath - if ((Test-Path -Path $vcVarsPath\vcvarsall.bat) -eq $false) { - throw "Could not find Visual Studio vcvarsall.bat at $vcVarsPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed." + if ((Test-Path -Path $vcPath\vcvarsall.bat) -eq $false) { + throw "Could not find Visual Studio vcvarsall.bat at $vcPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed." } # setup msbuild configuration @@ -366,7 +366,7 @@ Fix steps: $nativeResourcesFolder = $_ Get-ChildItem $nativeResourcesFolder -Filter "*.mc" | % { $command = @" -cmd.exe /C cd /d "$currentLocation" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" mc.exe -o -d -c -U "$($_.FullName)" -h "$nativeResourcesFolder" -r "$nativeResourcesFolder" +cmd.exe /C cd /d "$currentLocation" "&" "$($vcPath)\vcvarsall.bat" "$NativeHostArch" "&" mc.exe -o -d -c -U "$($_.FullName)" -h "$nativeResourcesFolder" -r "$nativeResourcesFolder" "@ log " Executing mc.exe Command: $command" Start-NativeExecution { Invoke-Expression -Command:$command 2>&1 } @@ -389,7 +389,7 @@ cmd.exe /C cd /d "$currentLocation" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeH $location = Get-Location $command = @" -cmd.exe /C cd /d "$location" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch" "&" cmake "$overrideFlags" -DBUILD_ONECORE=$OneCoreValue -DBUILD_TARGET_ARCH=$NativeHostArch -G "$cmakeGenerator" . "&" msbuild ALL_BUILD.vcxproj "/p:Configuration=$msbuildConfiguration" +cmd.exe /C cd /d "$location" "&" "$($vcPath)\vcvarsall.bat" "$NativeHostArch" "&" cmake "$overrideFlags" -DBUILD_ONECORE=$OneCoreValue -DBUILD_TARGET_ARCH=$NativeHostArch -G "$cmakeGenerator" . "&" msbuild ALL_BUILD.vcxproj "/p:Configuration=$msbuildConfiguration" "@ log " Executing Build Command: $command" Start-NativeExecution { Invoke-Expression -Command:$command }