Skip to content

Commit 4d3b779

Browse files
authored
Update Bazel build to fix warnings and a failure
1 parent 07e1dea commit 4d3b779

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

BUILD.bazel

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ LOCAL_DEFINES = [
2424
"HAVE_CONFIG_H",
2525
"HAVE_MEMMOVE",
2626
"HAVE_STRERROR",
27-
"PCRE2_CODE_UNIT_WIDTH=8",
2827
"PCRE2_STATIC",
2928
"SUPPORT_PCRE2_8",
3029
"SUPPORT_UNICODE",
@@ -99,20 +98,39 @@ cc_library(
9998
],
10099
hdrs = [":pcre2_h_generic"],
101100
implementation_deps = [":pcre2_internal_headers"],
102-
local_defines = LOCAL_DEFINES,
101+
local_defines = LOCAL_DEFINES + [
102+
"PCRE2_CODE_UNIT_WIDTH=8",
103+
],
103104
strip_include_prefix = "src",
104105
visibility = ["//visibility:public"],
105106
)
106107

108+
# See below for explanation of why we need this.
109+
#
110+
# https://github.com/bazelbuild/bazel/issues/680
111+
cc_library(
112+
name = "pcre2posix_dotc_headers",
113+
hdrs = [
114+
"src/pcre2_tables.c",
115+
],
116+
strip_include_prefix = "src",
117+
visibility = ["//visibility:private"],
118+
)
119+
107120
cc_library(
108121
name = "pcre2-posix",
109122
srcs = ["src/pcre2posix.c"],
110123
hdrs = ["src/pcre2posix.h"],
111124
implementation_deps = [":pcre2_internal_headers"],
112-
local_defines = LOCAL_DEFINES,
125+
local_defines = LOCAL_DEFINES + [
126+
"PCRE2_CODE_UNIT_WIDTH=8",
127+
],
113128
strip_include_prefix = "src",
114129
visibility = ["//visibility:public"],
115-
deps = [":pcre2"],
130+
deps = [
131+
":pcre2",
132+
":pcre2posix_dotc_headers",
133+
],
116134
)
117135

118136
# Totally weird issue in Bazel. It won't let you #include any files unless they

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module(
44
compatibility_level = 1,
55
)
66

7-
bazel_dep(name = "rules_cc", version = "0.0.1")
8-
bazel_dep(name = "bazel_skylib", version = "1.2.1")
9-
bazel_dep(name = "platforms", version = "0.0.4")
7+
bazel_dep(name = "rules_cc", version = "0.2.8")
8+
bazel_dep(name = "bazel_skylib", version = "1.8.1")
9+
bazel_dep(name = "platforms", version = "1.0.0")

0 commit comments

Comments
 (0)