Skip to content

Commit 6abf03b

Browse files
stinosdpgeorge
authored andcommitted
windows/msvc: Fix module freezing.
Make this more generally useful and in line with what the mingw and unix ports do: 16bit dig size to work on 32bit ports, a self-contained qstrdefs.preprocessed.h because makemanifest.py uses that, and a dev variant which effectively puts this to use: previously the uasyncio module wasn't frozen but instead tests ran by importing it from the extmod/ directory.
1 parent 7e9a159 commit 6abf03b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Diff for: ports/windows/.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ before_build:
3434
<?xml version="1.0" encoding="utf-8"?>
3535
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3636
<Target Name="Build">
37-
<MsBuild BuildInParallel="True" Projects="mpy-cross\mpy-cross.vcxproj;ports\windows\micropython.vcxproj"/>
37+
<MsBuild Projects="mpy-cross\mpy-cross.vcxproj;ports\windows\micropython.vcxproj"/>
3838
</Target>
3939
</Project>
4040
"@ | Set-Content build.proj

Diff for: ports/windows/msvc/genhdr.targets

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
150150
<TmpFile>$(QstrGen).tmp</TmpFile>
151151
</PropertyGroup>
152152
<Exec Command="$(PyClTool) /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /E $(PyQstrDefs) $(QstrDefs) > $(DestDir)qstrdefs.preprocessed.h"/>
153-
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdata.py $(DestDir)qstrdefs.preprocessed.h $(QstrDefsCollected) > $(TmpFile)"/>
153+
<!--Because makemanifest.py relies on this file to have all Q() and QCFG() entries.-->
154+
<Exec Command="type $(QstrDefsCollected) >> $(DestDir)qstrdefs.preprocessed.h"/>
155+
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdata.py $(DestDir)qstrdefs.preprocessed.h > $(TmpFile)"/>
154156
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(QstrGen)"/>
155157
</Target>
156158

@@ -167,7 +169,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
167169
<ItemGroup>
168170
<ClCompile Include="$(PyBuildDir)frozen_content.c"/>
169171
<ClCompile>
170-
<PreprocessorDefinitions>MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;%(PreprocessorDefinitions)</PreprocessorDefinitions>
172+
<PreprocessorDefinitions>MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;MPZ_DIG_SIZE=16;%(PreprocessorDefinitions)</PreprocessorDefinitions>
171173
</ClCompile>
172174
</ItemGroup>
173175
<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)"/>

Diff for: ports/windows/variants/dev/mpconfigvariant.props

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
3+
<PropertyGroup>
4+
<FrozenManifest>$(PyVariantDir)manifest.py</FrozenManifest>
5+
</PropertyGroup>
36
<ItemDefinitionGroup>
47
<ClCompile>
58
<PreprocessorDefinitions>%(PreprocessorDefinitions);MICROPY_ROM_TEXT_COMPRESSION=1</PreprocessorDefinitions>

0 commit comments

Comments
 (0)