Fix SCMRevGen for 64-bit MSBuild

CScript must be run as 64-bit regardless of the MSBuild bitness. Otherwise it won't find 64-bit Git installations.
However the "Sysnative" redirector is not available for 64-bit processes. So a fix is needed when 64-bit MSBuild is run.
The "ProgramFiles(x86)" Macro is only set for 64-bit, otherwise it is empty. Therefore it can be used as condition to check whether the current MSBuild process is 32 or 64-bit.
This commit is contained in:
Julian Löhr 2016-06-27 12:32:58 +02:00 committed by Julian Löhr
parent cf2c5e276c
commit 6f65293131
1 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,10 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VSProps\Base.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Label="UserMacros">
<CScript Condition="'$(ProgramFiles(x86))' != ''">%windir%\System32\cscript</CScript>
<CScript Condition="'$(ProgramFiles(x86))' == ''">%windir%\Sysnative\cscript</CScript>
</PropertyGroup>
<!--
OutDir is always created, which is annoying for SCMRevGen as it doesn't really have an outdir.
Here it's redirected to some other place to hide the annoyance.
@ -36,7 +39,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<PreBuildEvent>
<Command>"%windir%\Sysnative\cscript" /nologo /E:JScript "make_scmrev.h.js"</Command>
<Command>"$(CScript)" /nologo /E:JScript "make_scmrev.h.js"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>