| 1 | From 0d936b3e64e1e629bd29fa4dd84240f5c5344092 Mon Sep 17 00:00:00 2001 |
| 2 | From: LN Liberda <[email protected]> |
| 3 | Date: Tue, 26 Nov 2024 19:28:59 +0100 |
| 4 | Subject: [PATCH] build: option to not embed icu data |
| 5 | |
| 6 | Bug: none |
| 7 | --- |
| 8 | runtime/bin/BUILD.gn | 11 ++++++++--- |
| 9 | runtime/runtime_args.gni | 3 +++ |
| 10 | 2 files changed, 11 insertions(+), 3 deletions(-) |
| 11 | |
| 12 | diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn |
| 13 | index 90dc09a0c02..8f88873dc18 100644 |
| 14 | --- a/runtime/bin/BUILD.gn |
| 15 | +++ b/runtime/bin/BUILD.gn |
| 16 | @@ -795,7 +795,6 @@ template("dart_executable") { |
| 17 | } |
| 18 | deps = [ |
| 19 | ":crashpad", |
| 20 | - ":icudtl_cc", |
| 21 | "//third_party/boringssl", |
| 22 | "//third_party/icu:icui18n", |
| 23 | "//third_party/icu:icuuc", |
| 24 | @@ -804,7 +803,11 @@ template("dart_executable") { |
| 25 | if (is_fuchsia) { |
| 26 | deps += [ "$fuchsia_sdk/pkg/fdio" ] |
| 27 | } |
| 28 | - defines = [ "DART_EMBED_ICU_DATA" ] + extra_defines |
| 29 | + defines = extra_defines |
| 30 | + if (dart_embed_icu_data) { |
| 31 | + defines += [ "DART_EMBED_ICU_DATA" ] |
| 32 | + deps += [ ":icudtl_cc" ] |
| 33 | + } |
| 34 | if (exclude_kernel_service) { |
| 35 | defines += [ "EXCLUDE_CFE_AND_KERNEL_PLATFORM" ] |
| 36 | } |
| 37 | @@ -1004,10 +1004,12 @@ |
| 38 | "..:add_empty_macho_section_config", |
| 39 | ] |
| 40 | extra_deps = [ |
| 41 | - ":icudtl_cc", |
| 42 | "..:libdart_aotruntime", |
| 43 | "../platform:libdart_platform_aotruntime", |
| 44 | ] |
| 45 | + if (dart_embed_icu_data) { |
| 46 | + extra_deps += [":icudtl_cc"] |
| 47 | + } |
| 48 | extra_sources = [ |
| 49 | "builtin.cc", |
| 50 | "gzip.cc", |
| 51 | diff --git a/runtime/runtime_args.gni b/runtime/runtime_args.gni |
| 52 | index fbcfeb157fb..061e8f74a5c 100644 |
| 53 | --- a/runtime/runtime_args.gni |
| 54 | +++ b/runtime/runtime_args.gni |
| 55 | @@ -77,6 +77,9 @@ declare_args() { |
| 56 | |
| 57 | # Whether to support dynamic loading and interpretation of Dart bytecode. |
| 58 | dart_dynamic_modules = false |
| 59 | + |
| 60 | + # Whether to embed ICU data inside the runtime binary. |
| 61 | + dart_embed_icu_data = true |
| 62 | } |
| 63 | |
| 64 | declare_args() { |