Made icudt file much smaller

This commit is contained in:
Yousef Khadadeh 2025-11-15 09:48:02 +03:00
parent 78a2b5918b
commit e451e8b181
4 changed files with 4 additions and 4 deletions

View file

@ -425,7 +425,7 @@ class ConanSkia(ConanFile):
self.requires("expat/[>=2.5.0]")
if self.options.use_icu and self.options.use_system_icu and self.options.use_conan_icu:
self.requires("icu/[>=77.1]")
self.requires("icu/77.1")
if (self.options.use_libpng_decode or self.options.use_libpng_encode) and self.options.use_system_libpng and self.options.use_conan_libpng:
self.requires("libpng/[>=1.6.32]")
@ -537,7 +537,7 @@ class ConanSkia(ConanFile):
if self.options.use_icu and self.options.use_system_icu and self.options.use_conan_icu:
replace_in_file(self, join(self.source_folder, "third_party", "icu", "BUILD.gn"),
# icu-data must come after other components, otherwise it leaves an undefined symbol in shared library.
"libs = [ \"icuuc\" ]", f"libs = {json.dumps(self._link_libs('icu', components=['icu-uc','icu-data']))}",
"libs = [ \"icuuc\" ]", f"libs = {json.dumps(self._link_libs('icu', components=['icu-uc']))}", # 'icu-data' removed
strict=False)
if (self.options.use_libjpeg_turbo_encode or self.options.use_libjpeg_turbo_decode) and self.options.use_system_libjpeg_turbo and self.options.use_conan_libjpeg_turbo:

BIN
data/icudt77l-small.dat Executable file

Binary file not shown.

Binary file not shown.

View file

@ -389,11 +389,11 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
switch_cwd();
UErrorCode uerr = U_ZERO_ERROR;
icudt = read_file_to_string("data/icudt77l.dat");
icudt = read_file_to_string("data/icudt77l-small.dat");
udata_setCommonData((void *) icudt.data(), &uerr);
if (U_FAILURE(uerr)) {
char* errorName = const_cast<char*>(u_errorName(uerr));
std::cout << "Failed to load icudt77l.dat" << std::endl;
std::cout << "Failed to load icudt77l-small.dat" << std::endl;
std::cout << errorName << std::endl;
}