mirror of https://github.com/python/cpython
bpo-33614: Ensures module definition files for the stable ABI on Windows are correctly regenerated. (GH-7165)
This commit is contained in:
parent
c6c05d0e69
commit
e97ba4c690
|
@ -0,0 +1,2 @@
|
||||||
|
Ensures module definition files for the stable ABI on Windows are correctly
|
||||||
|
regenerated.
|
|
@ -47,5 +47,13 @@
|
||||||
@exit /b 1
|
@exit /b 1
|
||||||
|
|
||||||
:found
|
:found
|
||||||
@echo Using %MSBUILD% (found in the %_Py_MSBuild_Source%)
|
@pushd %MSBUILD% >nul 2>nul
|
||||||
|
@if not ERRORLEVEL 1 @(
|
||||||
|
@if exist msbuild.exe @(set MSBUILD="%CD%\msbuild.exe") else @(set MSBUILD=)
|
||||||
|
@popd
|
||||||
|
)
|
||||||
|
|
||||||
|
@if defined MSBUILD @echo Using %MSBUILD% (found in the %_Py_MSBuild_Source%)
|
||||||
|
@if not defined MSBUILD @echo Failed to find MSBuild
|
||||||
@set _Py_MSBuild_Source=
|
@set _Py_MSBuild_Source=
|
||||||
|
@if not defined MSBUILD @exit /b 1
|
||||||
|
|
|
@ -89,14 +89,18 @@
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
|
||||||
<Target Name="BuildPython3_dDef" BeforeTargets="BuildStubDef" Inputs="..\PC\python3.def" Outputs="$(IntDir)python3_d.def" Condition="$(Configuration) == 'Debug'">
|
<Target Name="BuildPython3_dDef" BeforeTargets="BuildStubDef" Condition="$(Configuration) == 'Debug'">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_DefLines Remove="@(_DefLines)" />
|
<_DefLines Remove="@(_DefLines)" />
|
||||||
<_Lines Remove="@(_Lines)" />
|
<_Lines Remove="@(_Lines)" />
|
||||||
|
<_OriginalLines Remove="@(_OriginalLines)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ReadLinesFromFile File="..\PC\python3.def">
|
<ReadLinesFromFile File="..\PC\python3.def">
|
||||||
<Output TaskParameter="Lines" ItemName="_DefLines" />
|
<Output TaskParameter="Lines" ItemName="_DefLines" />
|
||||||
</ReadLinesFromFile>
|
</ReadLinesFromFile>
|
||||||
|
<ReadLinesFromFile File="$(IntDir)python3_d.def" Condition="Exists('$(IntDir)python3_d.def')">
|
||||||
|
<Output TaskParameter="Lines" ItemName="_OriginalLines" />
|
||||||
|
</ReadLinesFromFile>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_Pattern1>(=python$(MajorVersionNumber)$(MinorVersionNumber))\.</_Pattern1>
|
<_Pattern1>(=python$(MajorVersionNumber)$(MinorVersionNumber))\.</_Pattern1>
|
||||||
<_Sub1>$1_d.</_Sub1>
|
<_Sub1>$1_d.</_Sub1>
|
||||||
|
@ -109,17 +113,23 @@
|
||||||
</_Lines>
|
</_Lines>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<MakeDir Directories="$(IntDir)" />
|
<MakeDir Directories="$(IntDir)" />
|
||||||
<WriteLinesToFile File="$(IntDir)python3_d.def" Lines="@(_Lines->'%(New)')" Overwrite="true" />
|
<Message Text="Updating python3_d.def" Condition="@(_Lines->'%(New)') != @(_OriginalLines)" Importance="high" />
|
||||||
|
<WriteLinesToFile File="$(IntDir)python3_d.def" Lines="@(_Lines->'%(New)')" Overwrite="true"
|
||||||
|
Condition="@(_Lines->'%(New)') != @(_OriginalLines)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="BuildStubDef" BeforeTargets="PreLinkEvent" Inputs="..\PC\python3.def" Outputs="$(IntDir)python3stub.def">
|
<Target Name="BuildStubDef" BeforeTargets="PreLinkEvent">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_DefLines Remove="@(_DefLines)" />
|
<_DefLines Remove="@(_DefLines)" />
|
||||||
<_Lines Remove="@(_Lines)" />
|
<_Lines Remove="@(_Lines)" />
|
||||||
|
<_OriginalLines Remove="@(_OriginalLines)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ReadLinesFromFile File="..\PC\python3.def">
|
<ReadLinesFromFile File="..\PC\python3.def">
|
||||||
<Output TaskParameter="Lines" ItemName="_DefLines" />
|
<Output TaskParameter="Lines" ItemName="_DefLines" />
|
||||||
</ReadLinesFromFile>
|
</ReadLinesFromFile>
|
||||||
|
<ReadLinesFromFile File="$(IntDir)python3stub.def" Condition="Exists('$(IntDir)python3stub.def')">
|
||||||
|
<Output TaskParameter="Lines" ItemName="_OriginalLines" />
|
||||||
|
</ReadLinesFromFile>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_Pattern>^[\w.]+=.+?\.([^ ]+).*$</_Pattern>
|
<_Pattern>^[\w.]+=.+?\.([^ ]+).*$</_Pattern>
|
||||||
<_Sub>$1</_Sub>
|
<_Sub>$1</_Sub>
|
||||||
|
@ -132,6 +142,8 @@
|
||||||
<_Lines Include="@(_Symbols->'%(Symbol)')" />
|
<_Lines Include="@(_Symbols->'%(Symbol)')" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<MakeDir Directories="$(IntDir)" />
|
<MakeDir Directories="$(IntDir)" />
|
||||||
<WriteLinesToFile File="$(IntDir)python3stub.def" Lines="@(_Lines)" Overwrite="true" />
|
<Message Text="Updating python3stub.def" Condition="@(_OriginalLines) != @(_Lines)" Importance="high" />
|
||||||
|
<WriteLinesToFile File="$(IntDir)python3stub.def" Lines="@(_Lines)" Overwrite="true"
|
||||||
|
Condition="@(_DefLines) != @(_Lines)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue