summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/build.bat4
-rw-r--r--PCbuild/pythoncore.vcxproj12
2 files changed, 13 insertions, 3 deletions
diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index 88b1f06..98fa267 100644
--- a/PCbuild/build.bat
+++ b/PCbuild/build.bat
@@ -105,6 +105,9 @@ if "%platf%"=="x64" (
)
)
+if not exist "%HG%" where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc"
+if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1
+
rem Setup the environment
call "%dir%env.bat" %vs_platf% >nul
@@ -142,6 +145,7 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
/p:IncludeExternals=%IncludeExternals%^
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
/p:UseTestMarker=%UseTestMarker%^
+ /p:HG="%HG%"^
%1 %2 %3 %4 %5 %6 %7 %8 %9
@echo off
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index e5e96ad..dc5c670 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -399,9 +399,15 @@
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild">
- <Exec Command="hg id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
- <Exec Command="hg id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
- <Exec Command="hg id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
+ <PropertyGroup>
+ <HG Condition="$(HG) == ''">hg</HG>
+ <_HG>$(HG)</_HG>
+ <_HG Condition="$(HG.Contains(` `))">"$(HG)"</_HG>
+ </PropertyGroup>
+ <Message Text="Getting build info from $(_HG)" Importance="high" />
+ <Exec Command="$(_HG) id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
+ <Exec Command="$(_HG) id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
+ <Exec Command="$(_HG) id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
<PropertyGroup>
<HgBranch Condition="Exists('$(IntDir)hgbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim())</HgBranch>
<HgVersion Condition="Exists('$(IntDir)hgversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim())</HgVersion>