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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user