From d05377c060f40c9287804d9cc0897d69eaae11a5 Mon Sep 17 00:00:00 2001 From: stijn Date: Thu, 23 Jun 2022 16:05:08 +0200 Subject: [PATCH] windows/msvc: Support compressed ROM text for error messages. Enable it in the dev variant as well for consistency with the makefile-based dev variant. --- ports/windows/msvc/genhdr.targets | 20 +++++++++++++++++-- .../variants/dev/mpconfigvariant.props | 5 +++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets index 11c5eae8ae..aa796088ef 100644 --- a/ports/windows/msvc/genhdr.targets +++ b/ports/windows/msvc/genhdr.targets @@ -4,7 +4,7 @@ - + @@ -16,6 +16,7 @@ $(DestDir)qstrdefs.generated.h $(DestDir)/moduledefs.collected $(DestDir)/root_pointers.collected + $(DestDir)/compressed.collected $(MICROPY_CPYTHON3) python cl.exe @@ -46,7 +47,8 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { foreach(var inFile in InputFiles) foreach(var line in System.IO.File.ReadAllLines(inFile)) - if((line.Contains(".c") && line.StartsWith("#line")) || line.Contains("MP_QSTR") || line.Contains("MP_REGISTER")) + if((line.Contains(".c") && line.StartsWith("#line")) || line.Contains("MP_QSTR") || + line.Contains("MP_REGISTER") || line.Contains("MP_COMPRESSED_ROM_TEXT")) outFile.WriteLine( line ); } ]]> @@ -101,6 +103,11 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { + + + + + @@ -129,6 +136,15 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { + + + $(DestDir)compressed.data.h + $(DestFile).tmp + + + + + $(QstrGen).tmp diff --git a/ports/windows/variants/dev/mpconfigvariant.props b/ports/windows/variants/dev/mpconfigvariant.props index 5f78d6e62a..0f7abf7815 100644 --- a/ports/windows/variants/dev/mpconfigvariant.props +++ b/ports/windows/variants/dev/mpconfigvariant.props @@ -3,4 +3,9 @@ micropython-dev + + + %(PreprocessorDefinitions);MICROPY_ROM_TEXT_COMPRESSION=1 + +