diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets
index 78e57a34ee..ed97a455d3 100644
--- a/ports/windows/msvc/genhdr.targets
+++ b/ports/windows/msvc/genhdr.targets
@@ -18,8 +18,14 @@
python
cl.exe
$([System.IO.Path]::Combine(`$(CLToolPath)`, `$(CLToolExe)`))
+ 120
+ $(PlatformToolset.Replace('v', ''))
+ True
+
+
@@ -57,6 +63,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
+ False
$([System.String]::new('%(FullPath)').Replace('$(PyBaseDir)', '$(DestDir)qstr\'))
@@ -71,13 +78,21 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
+ $(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D')
@(QstrDependencies->AnyHaveMetadataValue('Changed', 'True'))
@(PyQstrSourceFiles->AnyHaveMetadataValue('Changed', 'True'))
+
+
+ $(PyPreProcCommand) /Fi%(OutFile) /P %(Identity)
+ %(OutFile)
+
+
+
+
+
+
-
-