|
466 | 466 | <Message Text="Updated files: @(_UpdatedGetPath->'%(Filename)%(Extension)',', ')" |
467 | 467 | Condition="'@(_UpdatedGetPath)' != ''" Importance="high" /> |
468 | 468 | </Target> |
| 469 | + <Target Name="_GetBuildInfoHeader" BeforeTargets="PrepareForBuild" |
| 470 | + Inputs="" Outputs="Modules\getbuildinfo.h" |
| 471 | + DependsOnTargets="FindPythonForBuild"> |
| 472 | + <PropertyGroup> |
| 473 | + <GIT Condition="$(GIT) == ''">git</GIT> |
| 474 | + <_GIT>$(GIT)</_GIT> |
| 475 | + <_GIT Condition="$(GIT.Contains(` `))">"$(GIT)"</_GIT> |
| 476 | + </PropertyGroup> |
| 477 | + <Message Text="Getting build info from $(_GIT)" Importance="high" /> |
| 478 | + <MakeDir Directories="$(IntDir)" Condition="!Exists($(IntDir))" /> |
| 479 | + <Exec Command="$(_GIT) name-rev --name-only HEAD > "$(IntDir)gitbranch.txt"" ContinueOnError="true" /> |
| 480 | + <Exec Command="$(_GIT) rev-parse --short HEAD > "$(IntDir)gitversion.txt"" ContinueOnError="true" /> |
| 481 | + <Exec Command="$(_GIT) describe --all --always --dirty > "$(IntDir)gittag.txt"" ContinueOnError="true" /> |
| 482 | + <Exec Command='"$(GetCompilerExe)" > "$(IntDir)compiler.txt"' ContinueOnError="true" /> |
| 483 | + <PropertyGroup> |
| 484 | + <GitBranch Condition="Exists('$(IntDir)gitbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitbranch.txt').Trim())</GitBranch> |
| 485 | + <GitVersion Condition="Exists('$(IntDir)gitversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gitversion.txt').Trim())</GitVersion> |
| 486 | + <GitTag Condition="Exists('$(IntDir)gittag.txt')">$([System.IO.File]::ReadAllText('$(IntDir)gittag.txt').Trim())</GitTag> |
| 487 | + <Compiler Condition="Exists('$(IntDir)compiler.txt')">$([System.IO.File]::ReadAllText('$(IntDir)compiler.txt').Trim())</Compiler> |
| 488 | + |
| 489 | + <GilEnabled Condition="$(DisableGil) == 'true'">0</GilEnabled> |
| 490 | + <GilEnabled Condition="$(DisableGil) != 'true'">1</GilEnabled> |
| 491 | + </PropertyGroup> |
| 492 | + |
| 493 | + <Message Text="Run generate_getbuildinfo.py" Importance="high" /> |
| 494 | + <Exec Command='$(PythonForBuild) Tools/build/generate_getbuildinfo.py Modules\getbuildinfo.h win32 $(GitVersion) $(GitTag) $(GitBranch) "$(Compiler)" $(GilEnabled)' |
| 495 | + WorkingDirectory="$(PySourcePath)" /> |
| 496 | + </Target> |
469 | 497 | <Target Name="_RebuildFrozen" AfterTargets="AfterBuild" Condition="$(Configuration) != 'PGUpdate'"> |
470 | 498 | <Exec Command='"$(TargetPath)" "%(None.ModName)" "%(None.FullPath)" "%(None.IntFile)"' /> |
471 | 499 |
|
|
0 commit comments