mirror of
https://github.com/openai/codex.git
synced 2026-10-19 16:17:49 +00:00
## What changed Add `third_party/v8/icu.BUILD.bazel` and wire V8's ICU repository to use it instead of patching upstream `bazel/BUILD.icu`. Select ICU's custom libc++ flags and runtime dependencies through `//third_party/v8:use_rusty_v8_custom_libcxx`, keeping ICU aligned with V8 and its host generators. GitOrigin-RevId: 92a1b883f5d42d9a3a464002e922295ab166f2bd
114 lines
2.9 KiB
Plaintext
114 lines
2.9 KiB
Plaintext
# Copyright 2021 the V8 project authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
|
|
# ICU must use the same C++ runtime as the V8 artifact and its host generators.
|
|
_ICU_V8_COPTS = select({
|
|
"@@//third_party/v8:use_rusty_v8_custom_libcxx": [
|
|
"-nostdinc++",
|
|
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
|
|
"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE",
|
|
"-D_LIBCPP_INSTRUMENTED_WITH_ASAN=0",
|
|
"-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
|
|
],
|
|
"//conditions:default": [],
|
|
})
|
|
|
|
_ICU_V8_RUNTIME_DEPS = select({
|
|
"@@//third_party/v8:use_rusty_v8_custom_libcxx": [
|
|
"@@//third_party/v8:rusty_v8_custom_libcxx_headers",
|
|
"@@//third_party/v8:rusty_v8_custom_libcxx_runtime",
|
|
],
|
|
"//conditions:default": [],
|
|
})
|
|
|
|
filegroup(
|
|
name = "icudata",
|
|
srcs = ["common/icudtl.dat"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "icuuc",
|
|
srcs = glob([
|
|
"source/common/**/*.h",
|
|
"source/common/**/*.cpp",
|
|
]),
|
|
copts = ["-Wno-deprecated-declarations"] + _ICU_V8_COPTS,
|
|
data = [":icudata"],
|
|
defines = [
|
|
"HAVE_DLOPEN=0",
|
|
"UCONFIG_ONLY_HTML_CONVERSION=1",
|
|
"U_CHARSET_IS_UTF8=1",
|
|
"U_USING_ICU_NAMESPACE=0",
|
|
"U_ENABLE_DYLOAD=0",
|
|
"USE_CHROMIUM_ICU=1",
|
|
"U_ENABLE_TRACING=1",
|
|
"U_ENABLE_RESOURCE_TRACING=0",
|
|
"UNISTR_FROM_STRING_EXPLICIT=",
|
|
"UNISTR_FROM_CHAR_EXPLICIT=",
|
|
] + select({
|
|
"@platforms//os:windows": [
|
|
"U_STATIC_IMPLEMENTATION",
|
|
"UNICODE",
|
|
"_UNICODE",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
includes = [
|
|
"source/common",
|
|
"source/i18n",
|
|
],
|
|
local_defines = [
|
|
"U_COMMON_IMPLEMENTATION",
|
|
"U_ICUDATAENTRY_IN_COMMON",
|
|
],
|
|
tags = ["requires-rtti"],
|
|
deps = _ICU_V8_RUNTIME_DEPS,
|
|
alwayslink = 1,
|
|
)
|
|
|
|
cc_library(
|
|
name = "icui18n",
|
|
srcs = glob([
|
|
"source/i18n/**/*.h",
|
|
"source/i18n/**/*.cpp",
|
|
]),
|
|
copts = ["-Wno-deprecated-declarations"] + _ICU_V8_COPTS,
|
|
local_defines = [
|
|
"U_I18N_IMPLEMENTATION",
|
|
],
|
|
deps = [":icuuc"] + _ICU_V8_RUNTIME_DEPS,
|
|
alwayslink = 1,
|
|
)
|
|
|
|
cc_library(
|
|
name = "icu",
|
|
srcs = [
|
|
"source/stubdata/stubdata.cpp",
|
|
"source/stubdata/stubdata.h",
|
|
],
|
|
hdrs = glob([
|
|
"source/common/unicode/*.h",
|
|
"source/i18n/unicode/*.h",
|
|
]),
|
|
copts = select({
|
|
"@platforms//os:windows": [
|
|
"-Wno-deprecated-declarations",
|
|
],
|
|
"//conditions:default": [],
|
|
}) + _ICU_V8_COPTS,
|
|
include_prefix = "third_party/icu",
|
|
local_defines = [
|
|
"U_COMMON_IMPLEMENTATION",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":icui18n",
|
|
":icuuc",
|
|
] + _ICU_V8_RUNTIME_DEPS,
|
|
alwayslink = 1,
|
|
)
|