1"""Builds ICU library."""
2
3package(
4    default_visibility = ["//visibility:public"],
5)
6
7licenses(["notice"])  # Apache 2.0
8
9exports_files([
10    "icu4c/LICENSE",
11    "icu4j/main/shared/licenses/LICENSE",
12])
13
14cc_library(
15    name = "headers",
16    hdrs = glob(["icu4c/source/common/unicode/*.h"]),
17    includes = [
18        "icu4c/source/common",
19    ],
20    deps = [
21    ],
22)
23
24cc_library(
25    name = "common",
26    hdrs = glob(["icu4c/source/common/unicode/*.h"]),
27    includes = [
28        "icu4c/source/common",
29    ],
30    deps = [
31        ":icuuc",
32    ],
33)
34
35alias(
36    name = "nfkc",
37    actual = ":common",
38)
39
40alias(
41    name = "nfkc_cf",
42    actual = ":common",
43)
44
45cc_library(
46    name = "icuuc",
47    srcs = glob(
48        [
49            "icu4c/source/common/*.c",
50            "icu4c/source/common/*.cpp",
51            "icu4c/source/stubdata/*.cpp",
52        ],
53    ),
54    hdrs = glob([
55        "icu4c/source/common/*.h",
56    ]),
57    copts = [
58        "-DU_COMMON_IMPLEMENTATION",
59    ] + select({
60        ":android": [
61            "-fdata-sections",
62            "-DU_HAVE_NL_LANGINFO_CODESET=0",
63            "-Wno-deprecated-declarations",
64        ],
65        ":apple": [
66            "-Wno-shorten-64-to-32",
67            "-Wno-unused-variable",
68        ],
69        ":windows": [
70            "/utf-8",
71            "/DLOCALE_ALLOW_NEUTRAL_NAMES=0",
72        ],
73        "//conditions:default": [],
74    }),
75    tags = ["requires-rtti"],
76    visibility = [
77        "//visibility:private",
78    ],
79    deps = [
80        ":headers",
81    ],
82)
83
84config_setting(
85    name = "android",
86    values = {"crosstool_top": "//external:android/crosstool"},
87)
88
89config_setting(
90    name = "apple",
91    values = {"cpu": "darwin"},
92)
93
94config_setting(
95    name = "windows",
96    values = {"cpu": "x64_windows"},
97)
98