summaryrefslogtreecommitdiffstats
path: root/intl/icu/source/i18n/BUILD.bazel
blob: 2d85cdb180e1284048ec961ca33abf03404a920a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# © 2021 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html

# This file defines Bazel targets for a subset of the ICU4C "i18n" library header and source files.
# The configuration of dependencies among targets is strongly assisted by the
# file in depstest that maintains such information, at
# icu4c/source/test/depstest/dependencies.txt .

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

package(
    default_visibility = ["//visibility:public"],
)

# When compiling code in the `common` dir, the constant
# `U_I18n_IMPLEMENTATION` needs to be defined. See 
# https://unicode-org.github.io/icu/userguide/howtouseicu#c-with-your-own-build-system .

# If linker errors occur, then this may be a sign that the dependencies were 
# not specified correctly. Use dependencies.txt in depstest for assistance. See
# https://stackoverflow.com/q/66111709/2077918 .

cc_library(
    name = "headers",
    hdrs = glob([
        "unicode/*.h", # public
        "*.h",         # internal
    ]),
    # We need to add includes in order to preserve existing source files'
    # include directives that use traditional paths, not paths relative to
    # Bazel workspace:
    # https://stackoverflow.com/a/65635893/2077918
    includes = ["."],
    local_defines = [
        "U_I18N_IMPLEMENTATION",
    ],
)

cc_library(
    name = "collation",
    srcs = [
        "bocsu.cpp",
        "coleitr.cpp",
        "coll.cpp",
        "collation.cpp",
        "collationcompare.cpp",
        "collationdata.cpp",
        "collationdatareader.cpp",
        "collationdatawriter.cpp",
        "collationfastlatin.cpp",
        # collationfcd.cpp is generated by genuca;
        # probably hard to build genuca without depending on the old version.
        "collationfcd.cpp",
        "collationiterator.cpp",
        "collationkeys.cpp",
        "collationroot.cpp",
        "collationrootelements.cpp",
        "collationsets.cpp",
        "collationsettings.cpp",
        "collationtailoring.cpp",
        "rulebasedcollator.cpp",
        "sortkey.cpp",
        "ucol.cpp",
        "ucol_res.cpp",
        "ucol_sit.cpp",
        "ucoleitr.cpp",
        "uitercollationiterator.cpp",
        "utf16collationiterator.cpp",
        "utf8collationiterator.cpp",
    ],
    includes = ["."],
    deps = [
        ":headers",
        ":uclean_i18n",
        "//icu4c/source/common:bytestream",
        "//icu4c/source/common:normalizer2",
        "//icu4c/source/common:platform",
        "//icu4c/source/common:propname",
        "//icu4c/source/common:resourcebundle",
        "//icu4c/source/common:service_registration",
        "//icu4c/source/common:ucharstrieiterator",
        "//icu4c/source/common:uiter",
        "//icu4c/source/common:ulist",
        "//icu4c/source/common:unifiedcache",
        "//icu4c/source/common:uset",
        "//icu4c/source/common:usetiter",
        "//icu4c/source/common:utrie2",
        "//icu4c/source/common:uvector32",
        "//icu4c/source/common:uvector64",
    ],
    local_defines = [
        "U_I18N_IMPLEMENTATION",
    ],
)

cc_library(
    name = "collation_builder",
    srcs = [
        "collationbuilder.cpp",
        "collationdatabuilder.cpp",
        "collationfastlatinbuilder.cpp",
        "collationruleparser.cpp",
        "collationweights.cpp",
    ],
    includes = ["."],
    deps = [
        ":collation",
        "//icu4c/source/common:canonical_iterator",
        "//icu4c/source/common:ucharstriebuilder",
        "//icu4c/source/common:uset_props"
    ],
    local_defines = [
        "U_I18N_IMPLEMENTATION",
    ],
)

cc_library(
    name = "uclean_i18n",
    srcs = [
        "ucln_in.cpp",
    ],
    hdrs = ["ucln_in.h"],
    includes = ["."],
    deps = [
        "//icu4c/source/common:platform",
    ],
    local_defines = [
        "U_I18N_IMPLEMENTATION",
    ],
)