mirror of
https://github.com/python/cpython
synced 2024-09-15 23:46:26 +00:00
bpo-45582: Write empty pybuilddir.txt on Windows to allow relocatable build directories (GH-29979)
This commit is contained in:
parent
32a67246b0
commit
b0b3086279
|
@ -449,6 +449,10 @@ def search_up(prefix, *landmarks, test=isfile):
|
||||||
readlines(joinpath(real_executable_dir, BUILDDIR_TXT))[0],
|
readlines(joinpath(real_executable_dir, BUILDDIR_TXT))[0],
|
||||||
)
|
)
|
||||||
build_prefix = joinpath(real_executable_dir, VPATH)
|
build_prefix = joinpath(real_executable_dir, VPATH)
|
||||||
|
except IndexError:
|
||||||
|
# File exists but is empty
|
||||||
|
platstdlib_dir = real_executable_dir
|
||||||
|
build_prefix = joinpath(real_executable_dir, VPATH)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)):
|
if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)):
|
||||||
build_prefix = joinpath(real_executable_dir, VPATH)
|
build_prefix = joinpath(real_executable_dir, VPATH)
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration>
|
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration>
|
||||||
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
|
<LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
|
||||||
<AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
<AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF /CGTHREADS:1 /PDBTHREADS:1 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF %(AdditionalOptions)</AdditionalOptions>
|
||||||
</Link>
|
</Link>
|
||||||
<Lib>
|
<Lib>
|
||||||
<LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>
|
<LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>
|
||||||
|
|
|
@ -148,10 +148,6 @@ $(_PGOPath)
|
||||||
<WriteLinesToFile File="$(PySourcePath)python.bat" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" />
|
<WriteLinesToFile File="$(PySourcePath)python.bat" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="GeneratePyBuildDirTxt" BeforeTargets="AfterBuild">
|
<Target Name="GeneratePyBuildDirTxt" BeforeTargets="AfterBuild">
|
||||||
<PropertyGroup>
|
<WriteLinesToFile File="$(OutDir)pybuilddir.txt" Lines="" Overwrite="true" />
|
||||||
<_Content>$(OutDir)</_Content>
|
|
||||||
<_ExistingContent Condition="Exists('$(OutDir)pybuilddir.txt')">$([System.IO.File]::ReadAllText('$(OutDir)pybuilddir.txt'))</_ExistingContent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<WriteLinesToFile File="$(OutDir)pybuilddir.txt" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" />
|
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Reference in a new issue