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:
+3
-3
@@ -54,7 +54,7 @@
|
||||
#include "util/pool_registry.h"
|
||||
#include "ui/notifications.h"
|
||||
#include "ui/schema/skin_manager.h"
|
||||
#include "default_banlist_embedded.h"
|
||||
#include "embedded/embedded_text.h"
|
||||
#include "util/amount_format.h"
|
||||
#include "util/http_download.h"
|
||||
#include "data/exchange_info.h"
|
||||
@@ -3742,8 +3742,8 @@ void App::applyDefaultBanlist()
|
||||
if (!state_.connected || !rpc_ || !worker_) return;
|
||||
|
||||
// Parse the embedded default_banlist.txt (compiled from res/default_banlist.txt)
|
||||
std::string data(reinterpret_cast<const char*>(embedded::default_banlist_data),
|
||||
embedded::default_banlist_size);
|
||||
std::string data(reinterpret_cast<const char*>(g_default_banlist_data),
|
||||
g_default_banlist_size);
|
||||
|
||||
std::vector<std::string> ips;
|
||||
size_t pos = 0;
|
||||
|
||||
Reference in New Issue
Block a user