blob: 53f1251d114f0de245a73bdfa72a86164c6f4314 [file] [log] [blame]
# 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.
declare_args() {
# The GN files for the ICU library are located in this directory.
# Some Fuchsia builds use a different value here.
icu_root = "//third_party/icu/default"
}
# ~7ms per call.
# Executed only once to set the default value.
icu_git_info =
exec_script("gen-git-head-commit-id.sh",
[
"json",
rebase_path("//third_party/icu/default", root_build_dir),
rebase_path("//third_party/icu/latest", root_build_dir),
],
"json")
# The unflavored dependencies that must be replaced with flavored ones when
# compiling flavored targets. Defined because the correct contents are
# annoying to remember but must be specified exactly.
icu_fixup_deps_no_testonly = [
"//src/lib/icu:data",
"//src/lib/icu:icudtl",
"//src/lib/icu:lib",
]
icu_fixup_deps = icu_fixup_deps_no_testonly + [ "//src/lib/icu:icu" ]
# These can not be directly inserted in the assignments of
# `icu_flavor_major_versions` below, that is a GN limitation.
icu_default_config = read_file("//third_party/icu/default/version.json", "json")
icu_latest_config = read_file("//third_party/icu/latest/version.json", "json")
# The major version numbers per each ICU flavor.
# Automatically extracted from `version.json` in the ICU repo.
icu_flavor_major_versions = {
default = icu_default_config.major_version
latest = icu_latest_config.major_version
}
# A registry of the ICU flavors known to the build system.
#
# Each entry is a scope of:
# - name[string]: one of "default", "latest",
# - commit_id[string]: the git commit ID at which the flavor currently is.
# - major_version[string]: a string-formatted number, such as "73".
icu_flavors = [
{
name = "default"
commit_id = icu_git_info.default
major_version = icu_flavor_major_versions.default
},
{
name = "latest"
commit_id = icu_git_info.latest
major_version = icu_flavor_major_versions.latest
},
]