diff --git a/services/graphics-server/src/blitstr2/codegen/lib/templates.go b/services/graphics-server/src/blitstr2/codegen/lib/templates.go index 7942be80b..523b25a49 100644 --- a/services/graphics-server/src/blitstr2/codegen/lib/templates.go +++ b/services/graphics-server/src/blitstr2/codegen/lib/templates.go @@ -39,8 +39,8 @@ func RenderFontmapTemplate(fd []FontMap, small_fd []FontMap) string { context := fontmapTemplateContext{fd, small_fd} return renderTemplate(fontmapTemplate, "fontmap", context) } -func RenderLoadermodTemplate(fd []FontSummary) string { - context := loadermodTemplateContext{fd} +func RenderLoadermodTemplate(fd []FontSummary, small_fd []FontSummary) string { + context := loadermodTemplateContext{fd, small_fd} return renderTemplate(loadermodTemplate, "loadermod", context) } @@ -71,7 +71,8 @@ type fontmapTemplateContext struct { SmallFontDir []FontMap } type loadermodTemplateContext struct { - FontDir []FontSummary + FontDir []FontSummary + SmallFontDir []FontSummary } // Return a string from rendering the given template and context data @@ -171,7 +172,12 @@ const loadermodTemplate = `#![cfg_attr(rustfmt, rustfmt_skip)] // The order of these modules affects the link order in the loader, which is referred to in the graphics engine. // To make changes, see /services/graphics-server/src/blitstr2/codegen/main.go {{range $f := .FontDir}} -pub mod {{$f.Name}};{{end}}` +#[cfg(not(feature = "cramium-soc"))] +pub mod {{$f.Name}};{{end}} +{{range $f := .SmallFontDir}} +#[cfg(feature = "cramium-soc")] +pub mod {{$f.Name}};{{end}} +` const fontmapTemplate = `#![cfg_attr(rustfmt, rustfmt_skip)] // DO NOT MAKE EDITS HERE because this file is automatically generated.