[bazel] Adds zlib as local repo

This allows zlib to be overwritten in blaze.

No-Try: true
Bug: v8:11234
Change-Id: Id858076a4b744fdade7f6a23646d2d78d33723a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2993031
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75422}
This commit is contained in:
Victor Gomes 2021-06-28 17:45:08 +02:00 committed by V8 LUCI CQ
parent e8eba38458
commit 4504aef729
3 changed files with 61 additions and 63 deletions

View File

@ -2687,9 +2687,7 @@ v8_library(
":generated_torque_files",
":v8_shared_internal_headers",
],
deps = [
":third_party_zlib",
],
deps = [ "@zlib" ],
)
# TODO(victorgomes): Check if v8_enable_webassembly is true.
@ -2709,9 +2707,7 @@ v8_library(
":v8_shared_internal_headers",
":wee8_files",
],
deps = [
":third_party_zlib",
],
deps = [ "@zlib" ],
)
# =================================================
@ -2760,9 +2756,7 @@ v8_binary(
":torque_runtime_support_files",
":generated_torque_files",
],
deps = [
":third_party_zlib"
],
deps = [ "@zlib" ],
linkopts = select({
"is_android": [ "-llog" ],
"//conditions:default": [],
@ -2786,57 +2780,3 @@ v8_binary(
],
deps = [":v8"],
)
# =================================================
# third_party rules
# =================================================
cc_library(
name = "third_party_zlib",
srcs = [
"third_party/zlib/adler32.c",
"third_party/zlib/chromeconf.h",
"third_party/zlib/compress.c",
"third_party/zlib/contrib/optimizations/insert_string.h",
"third_party/zlib/cpu_features.c",
"third_party/zlib/cpu_features.h",
"third_party/zlib/crc32.c",
"third_party/zlib/crc32.h",
"third_party/zlib/deflate.c",
"third_party/zlib/deflate.h",
"third_party/zlib/gzclose.c",
"third_party/zlib/gzguts.h",
"third_party/zlib/gzlib.c",
"third_party/zlib/gzread.c",
"third_party/zlib/gzwrite.c",
"third_party/zlib/infback.c",
"third_party/zlib/inffast.c",
"third_party/zlib/inffast.h",
"third_party/zlib/inffixed.h",
"third_party/zlib/inflate.c",
"third_party/zlib/inflate.h",
"third_party/zlib/inftrees.c",
"third_party/zlib/inftrees.h",
"third_party/zlib/trees.c",
"third_party/zlib/trees.h",
"third_party/zlib/uncompr.c",
"third_party/zlib/zconf.h",
"third_party/zlib/zlib.h",
"third_party/zlib/zutil.c",
"third_party/zlib/zutil.h",
"third_party/zlib/google/compression_utils_portable.h",
"third_party/zlib/google/compression_utils_portable.cc",
],
hdrs = [
"third_party/zlib/google/compression_utils_portable.h",
],
defines = [
"CHROMIUM_ZLIB_NO_CHROMECONF",
"HAVE_HIDDEN",
"CPU_NO_SIMD",
],
copts = [
"-Ithird_party/zlib",
],
alwayslink = 1,
)

View File

@ -15,3 +15,9 @@ http_archive(
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
new_local_repository(
name = "zlib",
path = "third_party/zlib",
build_file = "bazel/BUILD.zlib",
)

52
bazel/BUILD.zlib Normal file
View File

@ -0,0 +1,52 @@
# 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.
cc_library(
name = "zlib",
srcs = [
"adler32.c",
"chromeconf.h",
"compress.c",
"contrib/optimizations/insert_string.h",
"cpu_features.c",
"cpu_features.h",
"crc32.c",
"crc32.h",
"deflate.c",
"deflate.h",
"gzclose.c",
"gzguts.h",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inffast.h",
"inffixed.h",
"inflate.c",
"inflate.h",
"inftrees.c",
"inftrees.h",
"trees.c",
"trees.h",
"uncompr.c",
"zconf.h",
"zlib.h",
"zutil.c",
"zutil.h",
"google/compression_utils_portable.h",
"google/compression_utils_portable.cc",
],
hdrs = [
"zlib.h",
"google/compression_utils_portable.h",
],
include_prefix = "third_party/zlib",
defines = [
"CHROMIUM_ZLIB_NO_CHROMECONF",
"HAVE_HIDDEN",
"CPU_NO_SIMD",
],
visibility = ["//visibility:public"],
)