summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorneonene <53406459+neonene@users.noreply.github.com>2021-12-10 17:13:55 (GMT)
committerGitHub <noreply@github.com>2021-12-10 17:13:55 (GMT)
commit3f398a77d37b5dfd51dabbc362d482a482fa885a (patch)
tree9ab6ad057291bc7ce12f9cf0286bd49556d5e407 /PCbuild
parent036bbb1d1b6156a1a72c40e9f907f302505085bc (diff)
downloadcpython-3f398a77d37b5dfd51dabbc362d482a482fa885a.zip
cpython-3f398a77d37b5dfd51dabbc362d482a482fa885a.tar.gz
cpython-3f398a77d37b5dfd51dabbc362d482a482fa885a.tar.bz2
bpo-45582: Fix test_embed failure during a PGO build on Windows (GH-30014)
This defines VPATH differently in PGO instrumentation builds, to account for a different default output directory. It also adds sys._vpath on Windows to make the value available to sysconfig so that it can be used in tests.
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/_freeze_module.vcxproj4
-rw-r--r--PCbuild/python.props4
-rw-r--r--PCbuild/pythoncore.vcxproj6
3 files changed, 11 insertions, 3 deletions
diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj
index 2c06a89..2beb425 100644
--- a/PCbuild/_freeze_module.vcxproj
+++ b/PCbuild/_freeze_module.vcxproj
@@ -226,7 +226,9 @@
<ClCompile Include="..\Python\structmember.c" />
<ClCompile Include="..\Python\suggestions.c" />
<ClCompile Include="..\Python\symtable.c" />
- <ClCompile Include="..\Python\sysmodule.c" />
+ <ClCompile Include="..\Python\sysmodule.c">
+ <PreprocessorDefinitions>VPATH="$(PyVPath)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
<ClCompile Include="..\Python\thread.c" />
<ClCompile Include="..\Python\traceback.c" />
</ItemGroup>
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 7b85ad1..ce86076 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -53,6 +53,10 @@
<BuildPath Condition="!HasTrailingSlash($(BuildPath))">$(BuildPath)\</BuildPath>
<BuildPath Condition="$(Configuration) == 'PGInstrument'">$(BuildPath)instrumented\</BuildPath>
+ <!-- VPATH definition (escaped) -->
+ <PyVPath Condition="$(Configuration) != 'PGInstrument'">..\\..</PyVPath>
+ <PyVPath Condition="$(Configuration) == 'PGInstrument'">..\\..\\..</PyVPath>
+
<!-- Directories of external projects. tcltk is handled in tcltk.props -->
<ExternalsDir>$(EXTERNALS_DIR)</ExternalsDir>
<ExternalsDir Condition="$(ExternalsDir) == ''">$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))</ExternalsDir>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index e3a71ca..33abfaf 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -115,7 +115,7 @@
PREFIX=NULL;
EXEC_PREFIX=NULL;
VERSION=NULL;
- VPATH="..\\..";
+ VPATH="$(PyVPath)";
PYDEBUGEXT="$(PyDebugExt)";
PLATLIBDIR="DLLs";
%(PreprocessorDefinitions)
@@ -519,7 +519,9 @@
<ClCompile Include="..\Python\suggestions.c" />
<ClCompile Include="..\Python\structmember.c" />
<ClCompile Include="..\Python\symtable.c" />
- <ClCompile Include="..\Python\sysmodule.c" />
+ <ClCompile Include="..\Python\sysmodule.c">
+ <PreprocessorDefinitions>VPATH="$(PyVPath)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
<ClCompile Include="..\Python\thread.c" />
<ClCompile Include="..\Python\traceback.c" />
</ItemGroup>