From: Steve Dower Date: Sat, 16 Jul 2016 23:13:19 +0000 (-0700) Subject: Fixes use of Py_IntDir and Py_OutDir to control build directories. X-Git-Tag: v3.6.0a4~162^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6fd76bceda3fefc5e5814108c5fe819050613d33;p=python Fixes use of Py_IntDir and Py_OutDir to control build directories. --- diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index a66184896a..b849783c8c 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -21,6 +21,15 @@ CleanAll true + + $(Platform) + $(Configuration) + + Build + Clean + CleanAll + true + @@ -35,6 +44,8 @@ + + @@ -58,9 +69,9 @@ - + false - + @@ -69,9 +80,20 @@ BuildInParallel="%(BuildInParallel)" StopOnFirstFailure="true" Targets="%(BuildTarget)" /> + + + 10.0.30319.1 10.0 $(BuildPath) - $(Py_OutDir) $(OutDir)\ - $(SolutionDir)obj\ - $(IntDir)\ + $(SolutionDir)obj\ $(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\ $(Py_IntDir)\$(ArchName)_PGO\$(ProjectName)\ $(ProjectName) @@ -29,7 +27,7 @@ - $(PySourcePath)Include;$(PySourcePath)PC;%(AdditionalIncludeDirectories) + $(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed @@ -85,9 +83,8 @@ true Win32 X64 - $(OutDir)wininst.tlb - - + $(OutDir)%(Filename).tlb + $(IntDir)%(Filename)_h.h diff --git a/PCbuild/python.props b/PCbuild/python.props index 843771d3f0..ee702105c2 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -32,8 +32,13 @@ $(PySourcePath)\ - $(PySourcePath)PCBuild\$(ArchName)\ - $(PyBuildPath) + $(PySourcePath)PCBuild\win32\ + $(Py_OutDir)\win32\ + $(PySourcePath)PCBuild\amd64\ + $(Py_OutDir)\amd64\ + $(BuildPath32) + $(BuildPath64) + $(PySourcePath)PCBuild\$(ArchName)\ $(BuildPath)\ diff --git a/Tools/msi/bundle/bootstrap/pythonba.vcxproj b/Tools/msi/bundle/bootstrap/pythonba.vcxproj index be12957112..bcd39512b0 100644 --- a/Tools/msi/bundle/bootstrap/pythonba.vcxproj +++ b/Tools/msi/bundle/bootstrap/pythonba.vcxproj @@ -31,7 +31,7 @@ DynamicLibrary Unicode - $(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\Bootstrap\ + $(Py_IntDir)\$(Configuration)_$(Platform)_Setup\Bootstrap\ $(IntDir) diff --git a/Tools/msi/make_zip.proj b/Tools/msi/make_zip.proj index d2e031f6b6..13f75ba849 100644 --- a/Tools/msi/make_zip.proj +++ b/Tools/msi/make_zip.proj @@ -16,7 +16,7 @@ $(OutputPath)\en-us\$(TargetName)$(TargetExt) rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)" "$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py" - $(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName) + $(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))" set DOC_FILENAME=python$(PythonVersion).chm set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index de978badce..0e8a4a69bb 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -90,23 +90,23 @@ def include_in_tools(p): return p.suffix.lower() in {'.py', '.pyw', '.txt'} FULL_LAYOUT = [ - ('/', 'PCBuild/$arch', 'python.exe', is_not_debug), - ('/', 'PCBuild/$arch', 'pythonw.exe', is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}.dll'.format(sys.version_info), is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug), - ('DLLs/', 'PCBuild/$arch', '*.pyd', is_not_debug), - ('DLLs/', 'PCBuild/$arch', '*.dll', is_not_debug_or_python), + ('/', '$build', 'python.exe', is_not_debug), + ('/', '$build', 'pythonw.exe', is_not_debug), + ('/', '$build', 'python{0.major}.dll'.format(sys.version_info), is_not_debug), + ('/', '$build', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug), + ('DLLs/', '$build', '*.pyd', is_not_debug), + ('DLLs/', '$build', '*.dll', is_not_debug_or_python), ('include/', 'include', '*.h', None), ('include/', 'PC', 'pyconfig.h', None), ('Lib/', 'Lib', '**/*', include_in_lib), - ('libs/', 'PCBuild/$arch', '*.lib', include_in_libs), + ('libs/', '$build', '*.lib', include_in_libs), ('Tools/', 'Tools', '**/*', include_in_tools), ] EMBED_LAYOUT = [ - ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), - ('/', 'PCBuild/$arch', '*.pyd', is_not_debug), - ('/', 'PCBuild/$arch', '*.dll', is_not_debug), + ('/', '$build', 'python*.exe', is_not_debug), + ('/', '$build', '*.pyd', is_not_debug), + ('/', '$build', '*.dll', is_not_debug), ('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib), ] @@ -168,18 +168,18 @@ def rglob(root, pattern, condition): def main(): parser = argparse.ArgumentParser() parser.add_argument('-s', '--source', metavar='dir', help='The directory containing the repository root', type=Path) - parser.add_argument('-o', '--out', metavar='file', help='The name of the output self-extracting archive', type=Path, default=None) + parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None) parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None) parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False) - parser.add_argument('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32") + parser.add_argument('-b', '--build', help='Specify the build directory', type=Path) ns = parser.parse_args() source = ns.source or (Path(__file__).resolve().parent.parent.parent) out = ns.out - arch = ns.arch + build = ns.build assert isinstance(source, Path) assert not out or isinstance(out, Path) - assert isinstance(arch, str) + assert isinstance(build, Path) if ns.temp: temp = ns.temp @@ -202,7 +202,10 @@ def main(): try: for t, s, p, c in layout: - s = source / s.replace("$arch", arch) + if s == '$build': + s = build + else: + s = source / s copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c)) print('Copied {} files'.format(copied)) diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index 9ae6d9988e..0cf7c7779f 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -47,7 +47,7 @@ - $(PySourcePath)PCBuild\obj\$(Configuration)_$(Platform)_Setup\$(OutputName) + $(Py_IntDir)\$(Configuration)_$(Platform)_Setup\$(OutputName) $(IntermediateOutputPath)_$(OutputSuffix) $(BuildPath) $(OutputPath)\ @@ -124,6 +124,12 @@ redist + + build32 + + + build64 +