• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2021 the V8 project authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5filegroup(
6    name = "icudata",
7    srcs = ["common/icudtl.dat"],
8)
9
10cc_library(
11    name = "icuuc",
12    srcs = glob([
13        "source/common/**/*.h",
14        "source/common/**/*.cpp",
15    ]),
16    copts = select({
17        "@platforms//os:windows": [
18            "/wd4005",  # Macro redefinition.
19            "/wd4068",  # Unknown pragmas.
20            "/wd4267",  # Conversion from size_t on 64-bits.
21            "/utf-8",  # ICU source files are in UTF-8.
22        ],
23        "//conditions:default": [
24            "-Wno-unused-function",
25            "-Wno-parentheses",
26            "-Wno-unused-function",
27            "-Wno-unused-variable",
28            "-Wno-deprecated-declarations",
29        ],
30    }),
31    data = [":icudata"],
32    defines = [
33        "U_COMMON_IMPLEMENTATION",
34        "U_ICUDATAENTRY_IN_COMMON",
35        "HAVE_DLOPEN=0",
36        "UCONFIG_ONLY_HTML_CONVERSION=1",
37        "U_CHARSET_IS_UTF8=1",
38        "U_USING_ICU_NAMESPACE=0",
39        "U_ENABLE_DYLOAD=0",
40        "USE_CHROMIUM_ICU=1",
41        "U_ENABLE_TRACING=1",
42        "U_ENABLE_RESOURCE_TRACING=0",
43        "UNISTR_FROM_STRING_EXPLICIT=",
44        "UNISTR_FROM_CHAR_EXPLICIT=",
45    ] + select({
46        "@platforms//os:windows": [
47            "U_STATIC_IMPLEMENTATION",
48            "UNICODE",
49            "_UNICODE",
50        ],
51        "//conditions:default": [],
52    }),
53    includes = [
54        "source/common",
55        "source/i18n",
56    ],
57    tags = ["requires-rtti"],
58    alwayslink = 1,
59)
60
61cc_library(
62    name = "icui18n",
63    srcs = glob([
64        "source/i18n/**/*.h",
65        "source/i18n/**/*.cpp",
66    ]),
67    copts = select({
68        "@platforms//os:windows": [
69            "/wd4005",  # Macro redefinition.
70            "/wd4068",  # Unknown pragmas.
71            "/wd4267",  # Conversion from size_t on 64-bits.
72            "/utf-8",  # ICU source files are in UTF-8.
73        ],
74        "//conditions:default": [],
75    }),
76    defines = [
77        "U_I18N_IMPLEMENTATION",
78    ] + select({
79        "@platforms//os:windows": [
80            "U_STATIC_IMPLEMENTATION",
81            "UNICODE",
82            "_UNICODE",
83        ],
84        "//conditions:default": [],
85    }),
86    deps = [":icuuc"],
87    alwayslink = 1,
88)
89
90cc_library(
91    name = "icu",
92    srcs = [
93        "source/stubdata/stubdata.cpp",
94    ],
95    hdrs = glob([
96        "source/common/unicode/*.h",
97        "source/i18n/unicode/*.h",
98    ]),
99    copts = select({
100        "@platforms//os:windows": [
101            "/wd4005",  # Macro redefinition.
102            "/wd4068",  # Unknown pragmas.
103            "/wd4267",  # Conversion from size_t on 64-bits.
104            "/utf-8",  # ICU source files are in UTF-8.
105        ],
106        "//conditions:default": [],
107    }),
108    defines = [
109        "U_I18N_IMPLEMENTATION",
110    ] + select({
111        "@platforms//os:windows": [
112            "U_STATIC_IMPLEMENTATION",
113            "UNICODE",
114            "_UNICODE",
115        ],
116        "//conditions:default": [],
117    }),
118    include_prefix = "third_party/icu",
119    visibility = ["//visibility:public"],
120    deps = [
121        ":icui18n",
122        ":icuuc",
123    ],
124    alwayslink = 1,
125)
126