blob: a5393ebc4aa6a9021d8839f7693f79c648e9abcd [file]
# Copyright 2023 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("config.gni") # icu_flavors
# This template creates groups of standard and icu-flavored dependencies.
#
# It creates a group for each icu flavor, which deps on the general 'deps' arg,
# plus the icu version of each of the icu_dependencies, adding the appropriate
# suffix for the flavor and commit id:
# .icu_${icu_flavor.name}_${icu_flavor.commit_id}
#
template("icu_aib_bazel_inputs") {
foreach(icu_flavor, icu_flavors) {
group("${target_name}.icu_${icu_flavor.name}_${icu_flavor.commit_id}") {
forward_variables_from(invoker, "*", [ "icu_dependencies" ])
if (!defined(deps)) {
deps = []
}
if (defined(invoker.icu_dependencies)) {
foreach(icu_dependency, invoker.icu_dependencies) {
dep_label = get_label_info(icu_dependency, "label_no_toolchain")
deps +=
[ "${dep_label}.icu_${icu_flavor.name}_${icu_flavor.commit_id}" ]
}
}
}
}
# Also produce the unflavored input bundle's dependencies
group("${target_name}") {
forward_variables_from(invoker, "*", [ "icu_dependencies" ])
if (!defined(deps)) {
deps = []
}
if (defined(invoker.icu_dependencies)) {
foreach(icu_dependency, invoker.icu_dependencies) {
deps += [ icu_dependency ]
}
}
}
}