summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-01 23:22:55 +0100
committerGitHub <noreply@github.com>2021-11-01 23:22:55 +0100
commit0fbf53dbc5cb07835b3afcf00bd2a20f780d09a6 (patch)
tree14728ccc87359d4f82f0b84c61bcc1f819733bcd
parent29a66f7b04924505d0694a8101eec16ffb8a7c11 (diff)
parent89cf17c96f1fe780a8aba62930411107ad2c7e59 (diff)
Merge pull request #54387 from Calinou/editor-translations-increase-zlib-compression-level
-rw-r--r--core/core_builders.py4
-rw-r--r--editor/editor_builders.py8
-rw-r--r--modules/mono/build_scripts/make_android_mono_config.py4
3 files changed, 12 insertions, 4 deletions
diff --git a/core/core_builders.py b/core/core_builders.py
index 004475faa7..b07daa80ae 100644
--- a/core/core_builders.py
+++ b/core/core_builders.py
@@ -35,7 +35,9 @@ def make_certs_header(target, source, env):
decomp_size = len(buf)
import zlib
- buf = zlib.compress(buf)
+ # Use maximum zlib compression level to further reduce file size
+ # (at the cost of initial build times).
+ buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef CERTS_COMPRESSED_GEN_H\n")
diff --git a/editor/editor_builders.py b/editor/editor_builders.py
index ff0daa86ff..67d4b8534f 100644
--- a/editor/editor_builders.py
+++ b/editor/editor_builders.py
@@ -26,7 +26,9 @@ def make_doc_header(target, source, env):
decomp_size = len(buf)
import zlib
- buf = zlib.compress(buf)
+ # Use maximum zlib compression level to further reduce file size
+ # (at the cost of initial build times).
+ buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef _DOC_DATA_RAW_H\n")
@@ -92,7 +94,9 @@ def make_translations_header(target, source, env, category):
with open(sorted_paths[i], "rb") as f:
buf = f.read()
decomp_size = len(buf)
- buf = zlib.compress(buf)
+ # Use maximum zlib compression level to further reduce file size
+ # (at the cost of initial build times).
+ buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
name = os.path.splitext(os.path.basename(sorted_paths[i]))[0]
g.write("static const unsigned char _{}_translation_{}_compressed[] = {{\n".format(category, name))
diff --git a/modules/mono/build_scripts/make_android_mono_config.py b/modules/mono/build_scripts/make_android_mono_config.py
index 28494bff6e..1920ef1c1a 100644
--- a/modules/mono/build_scripts/make_android_mono_config.py
+++ b/modules/mono/build_scripts/make_android_mono_config.py
@@ -8,7 +8,9 @@ def generate_compressed_config(config_src, output_dir):
decompr_size = len(buf)
import zlib
- buf = zlib.compress(buf)
+ # Use maximum zlib compression level to further reduce file size
+ # (at the cost of initial build times).
+ buf = zlib.compress(buf, zlib.Z_BEST_COMPRESSION)
compr_size = len(buf)
bytes_seq_str = ""