| # Copyright 2019 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. |
| |
| # This import must be here before "version.gni" below. |
| import("//build/icu/config.gni") # icu_root, icu_flavor_major_versions, |
| # icu_flavor_major_version_placeholder |
| |
| import("//build/dist/resource.gni") |
| import("//build/icu/icu_group.gni") |
| import("//build/icu/icu_resource.gni") |
| |
| import("${icu_root}/version.gni") |
| |
| # Automatically declares the correct ICU library major version number |
| # based on the configuration that is present in the ICU version |
| # configuration. |
| # |
| # This is used to ensure that atomic version upgrades of the ICU library |
| # are possible. Without this, manual changes to both ${icu_root} |
| # and //third_party/rust_crates would have been required. |
| config("version") { |
| rustenv = [ |
| # See https://github.com/google/rust_icu#features |
| "RUST_ICU_MAJOR_VERSION_NUMBER=${icu_major_version_number}", |
| ] |
| } |
| |
| config("version_default") { |
| rustenv = |
| [ "RUST_ICU_MAJOR_VERSION_NUMBER=${icu_flavor_major_versions.default}" ] |
| } |
| |
| config("version_latest") { |
| rustenv = |
| [ "RUST_ICU_MAJOR_VERSION_NUMBER=${icu_flavor_major_versions.latest}" ] |
| } |
| |
| group("icu") { |
| testonly = true |
| deps = [ ":tests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ "tools:tests" ] |
| } |
| |
| group("tools") { |
| testonly = true |
| deps = [ "tools:tools" ] |
| } |
| |
| # Depend on this library instead of //third_party/icu directly. |
| # DO NOT USE in icu_* target types, simply omit the dep. |
| group("lib") { |
| public_deps = [ "${icu_root}:icu" ] |
| } |
| |
| # Depend on this library instead of //third_party/icu:icudata directly. |
| # DO NOT USE in icu_* target types, simply omit the dep. |
| group("data") { |
| public_deps = [ "${icu_root}:icudata" ] |
| } |
| |
| icu_group("icudtl") { |
| icu_public_deps = [ |
| ":icudtl_orig", |
| ":icudtl_versioned", |
| ] |
| } |
| |
| icu_resource("icudtl_orig") { |
| sources = [ "${icu_root}/common/icudtl.dat" ] |
| outputs = [ "data/icudtl.dat" ] |
| } |
| |
| icu_resource("icudtl_versioned") { |
| sources = [ "${icu_root}/common/icudtl.dat" ] |
| outputs = [ "data/icudt${icu_major_version_number_placeholder}l.dat" ] |
| } |
| |
| icu_group("icudtl_root") { |
| public_deps = [ |
| ":icudtl_root_orig", |
| ":icudtl_root_versioned", |
| ] |
| } |
| |
| icu_resource("icudtl_root_orig") { |
| sources = [ "${icu_root}/common/icudtl.dat" ] |
| outputs = [ "icudtl.dat" ] |
| } |
| |
| icu_resource("icudtl_root_versioned") { |
| sources = [ "${icu_root}/common/icudtl.dat" ] |
| outputs = [ "icudt${icu_major_version_number}l.dat" ] |
| } |
| |
| config("default") { |
| defines = [ "FUCHSIA_ICU_VARIANT=0" ] |
| } |
| |
| config("latest") { |
| defines = [ "FUCHSIA_ICU_VARIANT=2" ] |
| } |
| |
| config("icu_root") { |
| defines = [ "FUCHSIA_ICU_VARIANT=3" ] |
| } |