Fix the build config regarding icu_disable_thin_archive
Previously the handling of icu_disable_thin_archive was in
a component in generate_icui18n template. Now generate_icui18n
invokes another template, and this causes an error of gn gen
when icu_disable_thin_archive flag, since 'configs' scope has
changed.
This CL moves the handling of icu_disable_thin_archive to the
new generate_icu_component template and introduces
check_thin_archive variable to keep the previous behavior.
Bug: 1129473
Test: gn gen with icu_disable_thin_archive=true
Change-Id: Id356785c487603e0e644cdbd19580ff1ee45ee25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2416397
Reviewed-by: Fabrice de Gans-Riberi <fdegans@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 07b7815..773df00 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -203,11 +203,19 @@
configs += [ ":icu_code" ]
configs += extra_configs
public_configs = [ ":icu_config" ]
+
+ # Make icu into a standalone static library. Currently This is only useful
+ # on Chrome OS.
+ if (invoker.check_thin_archive && icu_disable_thin_archive) {
+ configs -= [ "//build/config/compiler:thin_archive" ]
+ complete_static_lib = true
+ }
}
}
}
template("generate_icui18n") {
+ check_thin_archive = true
generate_icu_component(target_name) {
assert(defined(invoker.icuuc_deps), "Need the 'icuuc_deps' parameter.")
icuuc_deps = invoker.icuuc_deps
@@ -229,13 +237,6 @@
defines = [ "U_I18N_IMPLEMENTATION" ]
deps = icuuc_deps
-
- # Make icu into a standalone static library. Currently This is only useful on
- # Chrome OS.
- if (icu_disable_thin_archive) {
- configs -= [ "//build/config/compiler:thin_archive" ]
- complete_static_lib = true
- }
}
}
@@ -253,6 +254,7 @@
}
template("generate_icuuc") {
+ check_thin_archive = false
generate_icu_component(target_name) {
fuchsia_output_name_postfix = ""
if (defined(invoker.fuchsia_output_name_postfix)) {