Skip to content

Commit 3f9c458

Browse files
authored
Fix pcre2 target (#60)
* Fix external buck build * Finalize target
1 parent 5695ef1 commit 3f9c458

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

third-party/targets.bzl

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,22 +78,43 @@ def define_common_targets():
7878
cmd = "cp $SRCS $OUT",
7979
out = "pcre2/src/pcre2_chartables.c",
8080
)
81-
8281
runtime.cxx_library(
8382
name = "pcre2",
84-
srcs = glob([
85-
"pcre2/src/*.c",
86-
]) + [
83+
srcs = [
84+
"pcre2/src/pcre2_auto_possess.c",
85+
"pcre2/src/pcre2_chkdint.c",
86+
"pcre2/src/pcre2_compile.c",
87+
"pcre2/src/pcre2_compile_cgroup.c",
88+
"pcre2/src/pcre2_compile_class.c",
89+
"pcre2/src/pcre2_config.c",
90+
"pcre2/src/pcre2_context.c",
91+
"pcre2/src/pcre2_convert.c",
92+
"pcre2/src/pcre2_dfa_match.c",
93+
"pcre2/src/pcre2_error.c",
94+
"pcre2/src/pcre2_extuni.c",
95+
"pcre2/src/pcre2_find_bracket.c",
96+
"pcre2/src/pcre2_jit_compile.c",
97+
"pcre2/src/pcre2_maketables.c",
98+
"pcre2/src/pcre2_match.c",
99+
"pcre2/src/pcre2_match_data.c",
100+
"pcre2/src/pcre2_match_next.c",
101+
"pcre2/src/pcre2_newline.c",
102+
"pcre2/src/pcre2_ord2utf.c",
103+
"pcre2/src/pcre2_pattern_info.c",
104+
"pcre2/src/pcre2_script_run.c",
105+
"pcre2/src/pcre2_serialize.c",
106+
"pcre2/src/pcre2_string_utils.c",
107+
"pcre2/src/pcre2_study.c",
108+
"pcre2/src/pcre2_substitute.c",
109+
"pcre2/src/pcre2_substring.c",
110+
"pcre2/src/pcre2_tables.c",
111+
"pcre2/src/pcre2_ucd.c",
112+
"pcre2/src/pcre2_valid_utf.c",
113+
"pcre2/src/pcre2_xclass.c",
87114
":pcre2_chartables_c",
88115
],
89-
exported_headers = [
90-
":pcre2_h_generic",
91-
],
92-
headers = [
93-
":config_h_generic",
94-
] + glob([
95-
"pcre2/src/*.h",
96-
]),
116+
exported_headers = {"pcre2.h": ":pcre2_h_generic"},
117+
headers = {"config.h": ":config_h_generic"},
97118
# Preprocessor flags from https://github.com/PCRE2Project/pcre2/blob/2e03e323339ab692640626f02f8d8d6f95bff9c6/BUILD.bazel#L23.
98119
preprocessor_flags = [
99120
"-DHAVE_CONFIG_H",
@@ -107,7 +128,8 @@ def define_common_targets():
107128
"DEFAULT": ["-DHAVE_UNISTD_H"],
108129
"ovr_config//os:windows": [],
109130
}),
131+
header_namespace = "",
110132
_is_external_target = True,
111-
public_include_directories = ["pcre2"],
133+
include_directories = ["pcre2/src"],
112134
visibility = ["PUBLIC"],
113135
)

0 commit comments

Comments
 (0)