| # 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/stable", root_build_dir), |
| rebase_path("//third_party/icu/latest", root_build_dir), |
| ], |
| "json") |
| |
| # A registry of the ICU flavors known to the build system. |
| # |
| # Each entry is a scope of: |
| # - name[string]: one of "default", "latest", "stable" |
| # - commit_id[string]: the git commit ID at which the flavor currently is. |
| icu_flavors = [ |
| { |
| name = "default" |
| commit_id = icu_git_info.default |
| }, |
| { |
| name = "latest" |
| commit_id = icu_git_info.latest |
| }, |
| { |
| name = "stable" |
| commit_id = icu_git_info.stable |
| }, |
| ] |
| |
| # 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 = [ |
| "//src/lib/icu:data", |
| "//src/lib/icu:icu", |
| "//src/lib/icu:icudtl", |
| "//src/lib/icu:lib", |
| ] |
| |
| # 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_stable_config = read_file("//third_party/icu/stable/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 |
| stable = icu_stable_config.major_version |
| } |