diff --git a/windows/msvc/genhdr.targets b/windows/msvc/genhdr.targets
index 3d9a148bed..a2b4c80964 100644
--- a/windows/msvc/genhdr.targets
+++ b/windows/msvc/genhdr.targets
@@ -3,33 +3,74 @@
-
-
+
+
$(PyBuildDir)genhdr\
$(PyBaseDir)py\
+ $(PyBaseDir)unix\qstrdefsport.h
+ $(DestDir)qstrdefscollected.h
+ $(DestDir)qstrdefs.generated.h
python
+
+
+
+
-
-
- $(DestDir)qstrdefs.preprocessed.h
- $(PyBaseDir)unix\qstrdefsport.h
- $(DestDir)qstrdefs.generated.h
- $(DestFile).tmp
-
+
+
+
+ $([System.String]::new('%(FullPath)').Replace('$(PyBaseDir)', '$(DestDir)'))
+
+
+ $([System.IO.Path]::ChangeExtension('%(Qstr)', '.qstr'))
+ $([System.IO.Path]::ChangeExtension('%(Qstr)', '.pp'))
+ $([System.IO.Path]::GetDirectoryName('%(Qstr)'))
+ $([System.String]::new('%(FileName)').Contains('qstrdefs'))
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(DestFile).tmp
+
+
+