Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 6d41bfa

Browse files
author
Anselm Kruis
committed
merge branch 3.5
2 parents 1085a35 + 6fd76bc commit 6d41bfa

File tree

7 files changed

+73
-34
lines changed

7 files changed

+73
-34
lines changed

PCbuild/pcbuild.proj

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
<CleanAllTarget>CleanAll</CleanAllTarget>
2222
<BuildInParallel>true</BuildInParallel>
2323
</Projects>
24+
<Projects2>
25+
<Platform>$(Platform)</Platform>
26+
<Configuration>$(Configuration)</Configuration>
27+
<Properties></Properties>
28+
<BuildTarget>Build</BuildTarget>
29+
<CleanTarget>Clean</CleanTarget>
30+
<CleanAllTarget>CleanAll</CleanAllTarget>
31+
<BuildInParallel>true</BuildInParallel>
32+
</Projects2>
2433
</ItemDefinitionGroup>
2534
<ItemGroup>
2635
<!-- pythonXY.dll -->
@@ -35,6 +44,8 @@
3544
</Projects>
3645
<!-- python3.dll -->
3746
<Projects Include="python3dll.vcxproj" />
47+
<!-- pyshellext.dll -->
48+
<Projects Include="pyshellext.vcxproj" />
3849
<!-- py[w].exe -->
3950
<Projects Include="pylauncher.vcxproj;pywlauncher.vcxproj" />
4051
<!-- _freeze_importlib -->
@@ -58,9 +69,9 @@
5869
</Projects>
5970

6071
<!-- python[w].exe -->
61-
<Projects Include="python.vcxproj;pythonw.vcxproj">
72+
<Projects2 Include="python.vcxproj;pythonw.vcxproj">
6273
<BuildInParallel>false</BuildInParallel>
63-
</Projects>
74+
</Projects2>
6475
</ItemGroup>
6576

6677
<Target Name="Build">
@@ -69,9 +80,20 @@
6980
BuildInParallel="%(BuildInParallel)"
7081
StopOnFirstFailure="true"
7182
Targets="%(BuildTarget)" />
83+
<MSBuild Projects="@(Projects2)"
84+
Properties="Configuration=%(Configuration);Platform=%(Platform);%(Properties)"
85+
BuildInParallel="%(BuildInParallel)"
86+
StopOnFirstFailure="true"
87+
Targets="%(BuildTarget)" />
7288
</Target>
7389

7490
<Target Name="Clean">
91+
<MSBuild Projects="@(Projects2)"
92+
Properties="Configuration=%(Configuration);Platform=%(Platform);%(Properties)"
93+
BuildInParallel="%(BuildInParallel)"
94+
StopOnFirstFailure="false"
95+
Condition="%(CleanTarget) != ''"
96+
Targets="%(CleanTarget)" />
7597
<MSBuild Projects="@(Projects)"
7698
Properties="Configuration=%(Configuration);Platform=%(Platform);%(Properties)"
7799
BuildInParallel="%(BuildInParallel)"
@@ -81,6 +103,12 @@
81103
</Target>
82104

83105
<Target Name="CleanAll">
106+
<MSBuild Projects="@(Projects2)"
107+
Properties="Configuration=%(Configuration);Platform=%(Platform);%(Properties)"
108+
BuildInParallel="%(BuildInParallel)"
109+
StopOnFirstFailure="false"
110+
Condition="%(CleanAllTarget) != ''"
111+
Targets="%(CleanAllTarget)" />
84112
<MSBuild Projects="@(Projects)"
85113
Properties="Configuration=%(Configuration);Platform=%(Platform);%(Properties)"
86114
BuildInParallel="%(BuildInParallel)"

PCbuild/pyproject.props

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
55
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
66
<OutDir>$(BuildPath)</OutDir>
7-
<OutDir Condition="'$(Py_OutDir)' != ''">$(Py_OutDir)</OutDir>
87
<OutDir Condition="!HasTrailingSlash($(OutDir))">$(OutDir)\</OutDir>
9-
<Py_IntDir Condition="'$(Py_IntDir)' == ''">$(SolutionDir)obj\</Py_IntDir>
10-
<IntDir Condition="!HasTrailingSlash($(IntDir))">$(IntDir)\</IntDir>
8+
<Py_IntDir Condition="'$(PyIntDir)' == ''">$(SolutionDir)obj\</Py_IntDir>
119
<IntDir>$(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir>
1210
<IntDir Condition="$(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate'">$(Py_IntDir)\$(ArchName)_PGO\$(ProjectName)\</IntDir>
1311
<TargetName Condition="'$(TargetName)' == ''">$(ProjectName)</TargetName>
@@ -29,9 +27,9 @@
2927
</PropertyGroup>
3028
<ItemDefinitionGroup>
3129
<ClCompile>
32-
<AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;$(PySourcePath)Stackless;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
30+
<AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;$(PySourcePath)Stackless;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
3331
<PreprocessorDefinitions>WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions>
34-
32+
3533
<Optimization>MaxSpeed</Optimization>
3634
<IntrinsicFunctions>true</IntrinsicFunctions>
3735
<StringPooling>true</StringPooling>
@@ -85,9 +83,8 @@
8583
<SuppressStartupBanner>true</SuppressStartupBanner>
8684
<TargetEnvironment>Win32</TargetEnvironment>
8785
<TargetEnvironment Condition="'$(Platform)' == 'x64'">X64</TargetEnvironment>
88-
<TypeLibraryName>$(OutDir)wininst.tlb</TypeLibraryName>
89-
<HeaderFileName>
90-
</HeaderFileName>
86+
<TypeLibraryName>$(OutDir)%(Filename).tlb</TypeLibraryName>
87+
<HeaderFileName>$(IntDir)%(Filename)_h.h</HeaderFileName>
9188
</Midl>
9289
</ItemDefinitionGroup>
9390

@@ -129,15 +126,15 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
129126
</Code>
130127
</Task>
131128
</UsingTask>
132-
129+
133130
<Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'">
134131
<Message Text="Killing any running python$(PyDebugExt)$(PyTestExt).exe instances..." Importance="high" />
135132
<KillPython FileName="$(OutDir)python$(PyDebugExt)$(PyTestExt).exe" />
136133
</Target>
137-
134+
138135
<!--
139136
A default target to handle msbuild pcbuild.proj /t:CleanAll.
140-
137+
141138
Some externals projects don't respond to /t:Clean, so we invoke
142139
CleanAll on them when we really want to clean up.
143140
-->
@@ -156,7 +153,7 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
156153
<SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath>
157154
<_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand>
158155
</PropertyGroup>
159-
156+
160157
<Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
161158
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
162159
<Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />

PCbuild/python.props

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@
3232
<PySourcePath Condition="!HasTrailingSlash($(PySourcePath))">$(PySourcePath)\</PySourcePath>
3333

3434
<!-- Directory where build outputs are put -->
35-
<BuildPath Condition="'$(PyBuildPath)' == ''">$(PySourcePath)PCBuild\$(ArchName)\</BuildPath>
36-
<BuildPath Condition="'$(PyBuildPath)' != ''">$(PyBuildPath)</BuildPath>
35+
<BuildPath32 Condition="'$(Py_OutDir)' == ''">$(PySourcePath)PCBuild\win32\</BuildPath32>
36+
<BuildPath32 Condition="'$(Py_OutDir)' != ''">$(Py_OutDir)\win32\</BuildPath32>
37+
<BuildPath64 Condition="'$(Py_OutDir)' == ''">$(PySourcePath)PCBuild\amd64\</BuildPath64>
38+
<BuildPath64 Condition="'$(Py_OutDir)' != ''">$(Py_OutDir)\amd64\</BuildPath64>
39+
<BuildPath Condition="'$(ArchName)' == 'win32'">$(BuildPath32)</BuildPath>
40+
<BuildPath Condition="'$(ArchName)' == 'amd64'">$(BuildPath64)</BuildPath>
41+
<BuildPath Condition="'$(BuildPath)' == ''">$(PySourcePath)PCBuild\$(ArchName)\</BuildPath>
3742
<BuildPath Condition="!HasTrailingSlash($(BuildPath))">$(BuildPath)\</BuildPath>
3843

3944
<!-- Directories of external projects. tcltk is handled in tcltk.props -->

Tools/msi/bundle/bootstrap/pythonba.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<PropertyGroup Label="Configuration">
3232
<ConfigurationType>DynamicLibrary</ConfigurationType>
3333
<CharacterSet>Unicode</CharacterSet>
34-
<IntDir>$(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\Bootstrap\</IntDir>
34+
<IntDir>$(Py_IntDir)\$(Configuration)_$(Platform)_Setup\Bootstrap\</IntDir>
3535
<OutDir>$(IntDir)</OutDir>
3636
</PropertyGroup>
3737
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

Tools/msi/make_zip.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
1717
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)"</CleanCommand>
1818
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
19-
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName)</Arguments>
19+
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))"</Arguments>
2020
<Environment>set DOC_FILENAME=python$(PythonVersion).chm
2121
set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT</Environment>
2222
</PropertyGroup>

Tools/msi/make_zip.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ def include_in_tools(p):
9090
return p.suffix.lower() in {'.py', '.pyw', '.txt'}
9191

9292
FULL_LAYOUT = [
93-
('/', 'PCBuild/$arch', 'python.exe', is_not_debug),
94-
('/', 'PCBuild/$arch', 'pythonw.exe', is_not_debug),
95-
('/', 'PCBuild/$arch', 'python{0.major}.dll'.format(sys.version_info), is_not_debug),
96-
('/', 'PCBuild/$arch', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug),
97-
('DLLs/', 'PCBuild/$arch', '*.pyd', is_not_debug),
98-
('DLLs/', 'PCBuild/$arch', '*.dll', is_not_debug_or_python),
93+
('/', '$build', 'python.exe', is_not_debug),
94+
('/', '$build', 'pythonw.exe', is_not_debug),
95+
('/', '$build', 'python{0.major}.dll'.format(sys.version_info), is_not_debug),
96+
('/', '$build', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug),
97+
('DLLs/', '$build', '*.pyd', is_not_debug),
98+
('DLLs/', '$build', '*.dll', is_not_debug_or_python),
9999
('include/', 'include', '*.h', None),
100100
('include/', 'PC', 'pyconfig.h', None),
101101
('Lib/', 'Lib', '**/*', include_in_lib),
102-
('libs/', 'PCBuild/$arch', '*.lib', include_in_libs),
102+
('libs/', '$build', '*.lib', include_in_libs),
103103
('Tools/', 'Tools', '**/*', include_in_tools),
104104
]
105105

106106
EMBED_LAYOUT = [
107-
('/', 'PCBuild/$arch', 'python*.exe', is_not_debug),
108-
('/', 'PCBuild/$arch', '*.pyd', is_not_debug),
109-
('/', 'PCBuild/$arch', '*.dll', is_not_debug),
107+
('/', '$build', 'python*.exe', is_not_debug),
108+
('/', '$build', '*.pyd', is_not_debug),
109+
('/', '$build', '*.dll', is_not_debug),
110110
('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib),
111111
]
112112

@@ -168,18 +168,18 @@ def rglob(root, pattern, condition):
168168
def main():
169169
parser = argparse.ArgumentParser()
170170
parser.add_argument('-s', '--source', metavar='dir', help='The directory containing the repository root', type=Path)
171-
parser.add_argument('-o', '--out', metavar='file', help='The name of the output self-extracting archive', type=Path, default=None)
171+
parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None)
172172
parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None)
173173
parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False)
174-
parser.add_argument('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32")
174+
parser.add_argument('-b', '--build', help='Specify the build directory', type=Path)
175175
ns = parser.parse_args()
176176

177177
source = ns.source or (Path(__file__).resolve().parent.parent.parent)
178178
out = ns.out
179-
arch = ns.arch
179+
build = ns.build
180180
assert isinstance(source, Path)
181181
assert not out or isinstance(out, Path)
182-
assert isinstance(arch, str)
182+
assert isinstance(build, Path)
183183

184184
if ns.temp:
185185
temp = ns.temp
@@ -202,7 +202,10 @@ def main():
202202

203203
try:
204204
for t, s, p, c in layout:
205-
s = source / s.replace("$arch", arch)
205+
if s == '$build':
206+
s = build
207+
else:
208+
s = source / s
206209
copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c))
207210
print('Copied {} files'.format(copied))
208211

Tools/msi/msi.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</ItemGroup>
4848

4949
<PropertyGroup>
50-
<IntermediateOutputPath>$(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\$(OutputName)</IntermediateOutputPath>
50+
<IntermediateOutputPath>$(Py_IntDir)\$(Configuration)_$(Platform)_Setup\$(OutputName)</IntermediateOutputPath>
5151
<IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
5252
<OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
5353
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
@@ -124,6 +124,12 @@
124124
<LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT">
125125
<BindName>redist</BindName>
126126
</LinkerBindInputPaths>
127+
<LinkerBindInputPaths Include="$(BuildPath32)">
128+
<BindName>build32</BindName>
129+
</LinkerBindInputPaths>
130+
<LinkerBindInputPaths Include="$(BuildPath64)">
131+
<BindName>build64</BindName>
132+
</LinkerBindInputPaths>
127133
</ItemGroup>
128134

129135
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">

0 commit comments

Comments
 (0)