build: embed ui.toml and banlist with INCBIN instead of a configure loop

ui.toml and the default banlist were embedded by a CMake function that
read each file and emitted a C array header one byte at a time in a
configure-time loop. That is slow to configure, and because the result
is a header, editing either resource recompiled every translation unit
that included it.

- Both files are now embedded with INCBIN from a small generated
  translation unit, the same pattern already used for the fonts. There
  is no generated header, so editing a resource re-assembles one tiny
  object file instead of triggering a wide recompile, and configure does
  no per-byte work.
- Consumers include a hand-written header declaring the symbols and
  always use the embedded data (the __has_include fallback is gone). The
  data is not NUL-terminated, so every consumer passes an explicit size.
- The old EmbedResources.cmake script is removed, and the generated unit
  is added to the app and test builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 22:03:00 -05:00
co-authored by Claude Opus 4.8
parent 3fd52fbdaf
commit e77b960cc5
7 changed files with 41 additions and 99 deletions
+4
View File
@@ -0,0 +1,4 @@
// DragonX Wallet - INCBIN text-resource embedding (CMake-generated). Do NOT edit the generated copy.
#include "incbin.h"
INCBIN(ui_toml, "@CMAKE_SOURCE_DIR@/res/themes/ui.toml");
INCBIN(default_banlist, "@CMAKE_SOURCE_DIR@/res/default_banlist.txt");
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include <cstdint>
// Defined in generated/embedded_text.cpp via INCBIN (.incbin). Data is NOT NUL-terminated;
// every consumer passes an explicit size. Size is `unsigned int`.
extern "C" {
extern const unsigned char g_ui_toml_data[];
extern const unsigned int g_ui_toml_size;
extern const unsigned char g_default_banlist_data[];
extern const unsigned int g_default_banlist_size;
}