Skip to content

Commit

Permalink
Selectively define VSInstallRoot
Browse files Browse the repository at this point in the history
Commit 9b2d23b worked when using .NET Framework on Windows and
on macOS, but failed when using Windows + .NET Core, because
`dotnet build` *doesn't* define `%VSINSTALLROOT%` in that environment.

Update the `windows_dotnet_build` job so that `VSInstallRoot` is
defined.

Update the `NativeTiming` build so that it verifies that
`$(VSINSTALLROOT)` exists before trying to do anything with it.
  • Loading branch information
jonpryor committed Mar 6, 2021
1 parent 9b2d23b commit b66fc2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
msbuildArguments: /restore /t:Prepare

- task: MSBuild@1
displayName: VSBuild Java.Interop.sln
displayName: MSBuild Java.Interop.sln
inputs:
solution: Java.Interop.sln
configuration: $(Build.Configuration)
Expand All @@ -78,6 +78,9 @@ jobs:
displayName: Windows - .NET Core
pool: $(HostedWinVS2019)
timeoutInMinutes: 20
variables:
- name: VSInstallRoot
value: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
workspace:
clean: all
steps:
Expand Down
9 changes: 6 additions & 3 deletions tests/NativeTiming/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
</Target>

<Target Name="_GetBuildComands">
<ItemGroup Condition=" '$(VSINSTALLROOT)' != '' ">
<_Vcvarsall Include="$(VSINSTALLROOT)\VC\Auxiliary\Build\vcvarsall.bat" />
<ItemGroup>
<_Vcvarsall
Condition=" '$(VSINSTALLROOT)' != '' And Exists('$(VSINSTALLROOT)') "
Include="$(VSINSTALLROOT)\VC\Auxiliary\Build\vcvarsall.bat"
/>
</ItemGroup>
<PropertyGroup Condition=" '$(VSINSTALLROOT)' != '' And '$(_Vcvarsall->Count())' != '0' ">
<PropertyGroup Condition=" '@(_Vcvarsall->Count())' != '0' ">
<_Vcvarsall>%(_Vcvarsall.Identity)</_Vcvarsall>
<_PrepareToolchain>call "$(_Vcvarsall)" x86_amd64 &amp;&amp; </_PrepareToolchain>
</PropertyGroup>
Expand Down

0 comments on commit b66fc2f

Please sign in to comment.