summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2025-10-15 11:29:03 +0200
committerDamien George <damien@micropython.org>2025-10-24 18:01:13 +1100
commitd05f32f1eb6ce3a88eb5d6e9330a9feae571f823 (patch)
treee9bc1764ec1a40102dd3c75ac328362283250097
parent15401a3ae83c5e5652d30544eeaf189585066f52 (diff)
windows/msvc: Make the PP defs for manifest freezing global.
This is consistent with the other ports (see py/mkrules.mk) and makes more sense overall because it makes everything which is compiled use the same flags; until now all compilation steps which ran before or in absence of FreezeModules (e.g. qstr generation, compiling a single file on the command line or in the IDE) would use different PP defs. This didn't happen to cause any issues apparently but it's just more consistent/safer to not do that. Signed-off-by: stijn <stijn@ignitron.net>
-rw-r--r--ports/windows/msvc/common.props1
-rw-r--r--ports/windows/msvc/genhdr.targets3
2 files changed, 1 insertions, 3 deletions
diff --git a/ports/windows/msvc/common.props b/ports/windows/msvc/common.props
index 55c9c934f..b8d9096d6 100644
--- a/ports/windows/msvc/common.props
+++ b/ports/windows/msvc/common.props
@@ -23,6 +23,7 @@
<ClCompile>
<AdditionalIncludeDirectories>$(PyIncDirs);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions Condition="'$(FrozenManifest)' != ''">MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;MPZ_DIG_SIZE=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<WarningLevel>Level1</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets
index 7bd8364a9..57ec707ef 100644
--- a/ports/windows/msvc/genhdr.targets
+++ b/ports/windows/msvc/genhdr.targets
@@ -168,9 +168,6 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<Target Name="FreezeModules" Condition="'$(FrozenManifest)' != ''" DependsOnTargets="MakeQstrData;MakeRootPointers" Inputs="$(FrozenManifest)" Outputs="$(PyBuildDir)frozen_content.c">
<ItemGroup>
<ClCompile Include="$(PyBuildDir)frozen_content.c"/>
- <ClCompile>
- <PreprocessorDefinitions>MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;MPZ_DIG_SIZE=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
</ItemGroup>
<Exec Command="$(PyPython) $(PyBaseDir)tools\makemanifest.py -v MPY_DIR=$(PyBaseDir) -v MPY_LIB_DIR=$(PyBaseDir)/lib/micropython-lib -v PORT_DIR=$(PyWinDir) -o $(PyBuildDir)frozen_content.c -b $(PyBuildDir) $(FrozenManifest)"/>
<WriteLinesToFile File="$(TLogLocation)frozen.read.1.tlog" Lines="$(FrozenManifest)" Overwrite="True"/>