[bazel] Adds ICU

No-Try: true
Bug: v8:11234
Change-Id: I93bf3f096bd82faadd21abf08d61f06c0b823f7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2996189
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75471}
This commit is contained in:
Victor Gomes 2021-06-30 13:20:56 +02:00 committed by V8 LUCI CQ
parent fc668d5c37
commit 4937b43c64
3 changed files with 175 additions and 4 deletions

View File

@ -117,6 +117,7 @@ v8_flag(name = "v8_annotate_torque_ir")
v8_flag(name = "v8_enable_lazy_source_positions", default = True)
v8_flag(name = "v8_enable_minor_mc", default = True)
v8_flag(name = "v8_enable_webassembly", default = True)
v8_flag(name = "v8_enable_i18n_support", default = True)
v8_int(
name = "v8_typed_array_max_size_in_heap",
@ -128,6 +129,7 @@ v8_custom_config(name = "default")
v8_config(
name = "define_flags",
conditional_defines = {
"v8_enable_i18n_support": "V8_INTL_SUPPORT",
"v8_enable_lazy_source_positions": "V8_ENABLE_LAZY_SOURCE_POSITIONS",
"v8_enable_minor_mc": "ENABLE_MINOR_MC",
"v8_enable_webassembly": "V8_ENABLE_WEBASSEMBLY",
@ -631,7 +633,24 @@ filegroup(
"src/wasm/wasm-objects.tq",
],
"//conditions:default": [],
}),
}) + select({
":is_v8_enable_i18n_support": [
"src/objects/intl-objects.tq",
"src/objects/js-break-iterator.tq",
"src/objects/js-collator.tq",
"src/objects/js-date-time-format.tq",
"src/objects/js-display-names.tq",
"src/objects/js-list-format.tq",
"src/objects/js-locale.tq",
"src/objects/js-number-format.tq",
"src/objects/js-plural-rules.tq",
"src/objects/js-relative-time-format.tq",
"src/objects/js-segment-iterator.tq",
"src/objects/js-segmenter.tq",
"src/objects/js-segments.tq",
],
"//conditions:default": [],
})
)
filegroup(
@ -1984,10 +2003,55 @@ filegroup(
"src/wasm/wasm-value.h",
],
"//conditions:default": [],
}) + select({
":is_v8_enable_i18n_support": [
"src/builtins/builtins-intl.cc",
"src/builtins/builtins-intl-gen.cc",
"src/objects/intl-objects.cc",
"src/objects/intl-objects.h",
"src/objects/js-break-iterator.cc",
"src/objects/js-break-iterator.h",
"src/objects/js-break-iterator-inl.h",
"src/objects/js-collator.cc",
"src/objects/js-collator.h",
"src/objects/js-collator-inl.h",
"src/objects/js-date-time-format.cc",
"src/objects/js-date-time-format.h",
"src/objects/js-date-time-format-inl.h",
"src/objects/js-display-names.cc",
"src/objects/js-display-names.h",
"src/objects/js-display-names-inl.h",
"src/objects/js-list-format.cc",
"src/objects/js-list-format.h",
"src/objects/js-list-format-inl.h",
"src/objects/js-locale.cc",
"src/objects/js-locale.h",
"src/objects/js-locale-inl.h",
"src/objects/js-number-format.cc",
"src/objects/js-number-format.h",
"src/objects/js-number-format-inl.h",
"src/objects/js-plural-rules.cc",
"src/objects/js-plural-rules.h",
"src/objects/js-plural-rules-inl.h",
"src/objects/js-relative-time-format.cc",
"src/objects/js-relative-time-format.h",
"src/objects/js-relative-time-format-inl.h",
"src/objects/js-segmenter.cc",
"src/objects/js-segmenter.h",
"src/objects/js-segmenter-inl.h",
"src/objects/js-segment-iterator.cc",
"src/objects/js-segment-iterator.h",
"src/objects/js-segment-iterator-inl.h",
"src/objects/js-segments.cc",
"src/objects/js-segments.h",
"src/objects/js-segments-inl.h",
"src/runtime/runtime-intl.cc",
"src/strings/char-predicates.cc",
],
"//conditions:default": [],
}),
)
filegroup(
name = "v8_compiler_files",
srcs = [
@ -2664,6 +2728,14 @@ genrule(
tools = [":bytecode_builtins_list_generator"],
)
genrule(
name = "generated_regexp_special_case",
srcs = [],
outs = ["src/regexp/special-case.cc"],
cmd = "$(location :regexp_special_case_generator) $@",
tools = [":regexp_special_case_generator"],
)
v8_mksnapshot(
name = "generated_snapshot_files"
)
@ -2691,11 +2763,17 @@ v8_library(
":v8_libplatform_files",
":v8_libsampler_files",
":v8_shared_internal_headers",
],
] + select({
":is_v8_enable_i18n_support": [ ":generated_regexp_special_case" ],
"//conditions:default": [],
}),
deps = [
":v8_libbase",
"@zlib",
],
] + select({
":is_v8_enable_i18n_support": [ "@icu" ],
"//conditions:default": [],
}),
)
v8_library(
@ -2731,6 +2809,17 @@ v8_binary(
deps = [ "v8_libbase" ],
)
v8_binary(
name = "regexp_special_case_generator",
srcs = [
":v8_shared_internal_headers",
":v8_libbase_files",
"src/regexp/special-case.h",
"src/regexp/gen-regexp-special-case.cc",
],
deps = [ "@icu" ],
)
v8_binary(
name = "torque",
srcs = [

View File

@ -21,3 +21,9 @@ new_local_repository(
path = "third_party/zlib",
build_file = "bazel/BUILD.zlib",
)
new_local_repository(
name = "icu",
path = "third_party/icu",
build_file = "bazel/BUILD.icu",
)

76
bazel/BUILD.icu Normal file
View File

@ -0,0 +1,76 @@
# 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.
filegroup(
name = "icudata",
srcs = [ "common/icudtl.dat" ]
)
cc_library(
name = "icuuc",
srcs = glob([
"source/common/**/*.h",
"source/common/**/*.cpp"
]),
defines = [
"U_COMMON_IMPLEMENTATION",
"U_ICUDATAENTRY_IN_COMMON",
"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=",
"ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE",
],
copts = [
"-Wno-unused-function",
"-Wno-parentheses",
"-Wno-unused-function",
"-Wno-unused-variable",
"-Wno-deprecated-declarations",
],
includes = [
"source/common",
"source/i18n",
],
tags = ["requires-rtti"],
data = [ ":icudata" ],
alwayslink = 1,
)
cc_library(
name = "icui18n",
srcs = glob([
"source/i18n/**/*.h",
"source/i18n/**/*.cpp"
]),
defines = [
"U_I18N_IMPLEMENTATION",
],
deps = [ ":icuuc" ],
alwayslink = 1,
)
cc_library(
name = "icu",
hdrs = glob([
"source/common/unicode/*.h",
"source/i18n/unicode/*.h",
]),
srcs = [
"source/stubdata/stubdata.cpp",
],
include_prefix = "third_party/icu",
deps = [
":icuuc",
":icui18n"
],
visibility = ["//visibility:public"],
alwayslink = 1,
)