Add a flag for selecting the ICU data source on Fuchsia
Introduces a `declare_args()` of `icu_fuchsia_override_data_dir` which
allows the builds of Fuchsia to select an alternate `data_dir` for CLDR
data source.
Most of the time, this flag value remains at its default setting, except
for some special Fuchsia builds which need to use their own.
Change-Id: Ifc5c34831454b164e77652d1d7239f906b3255c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3566498
Reviewed-by: Frank Tang <ftang@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 7524f5d..5fc12b8 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -370,6 +370,9 @@
data_dir = "chromeos"
} else if (target_cpu == "wasm") {
data_dir = "flutter"
+} else if (icu_is_in_fuchsia && icu_fuchsia_override_data_dir != "") {
+ # See //config.gni for details.
+ data_dir = icu_fuchsia_override_data_dir
} else {
data_dir = "common"
}
diff --git a/config.gni b/config.gni
index 2e957aa..e4e062f 100644
--- a/config.gni
+++ b/config.gni
@@ -15,6 +15,11 @@
# If true, compile icu into a standalone static library. Currently this is
# only useful on Chrome OS.
icu_disable_thin_archive = false
+
+ # If set to nonempty, this is the label of the directory to be used to pull
+ # the ICU data files content. The setting has effect only when building
+ # inside the Fuchsia source tree.
+ icu_fuchsia_override_data_dir = ""
}
# Set to true if icu is being built from the Fuchsia tree.