@@ -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+
107120cc_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
0 commit comments