Skip to content

Commit 1953af5

Browse files
committed
fix pcre2 build errors
Our config header was missing some variables and defining unecessary ones. The source files were missing some definitions from SelectRegex.cmake. GIT_REGEX_PCRE2 flag is only used if linking system pcre2.
1 parent 5eb06cd commit 1953af5

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎build.zig‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub fn build(b: *std.Build) !void {
2424
.{
2525
.GIT_THREADS = 1,
2626
.GIT_USE_NSEC = 1,
27-
.GIT_REGEX_PCRE2 = 1,
2827
},
2928
);
3029

@@ -292,18 +291,17 @@ pub fn build(b: *std.Build) !void {
292291
pcre2.addConfigHeader(b.addConfigHeader(
293292
.{ .style = .{ .cmake = libgit_src.path("deps/pcre2/config.h.in") } },
294293
.{
295-
.PCRE2_EXPORT = null,
296294
.SUPPORT_PCRE2_8 = 1,
297-
.PCRE2_HEAP_LIMIT = 20000000,
298-
.PCRE2_MAX_VARLOOKBEHIND = 255,
295+
.SUPPORT_UNICODE = 1,
296+
.NEWLINE_DEFAULT = 2,
299297
.PCRE2_LINK_SIZE = 2,
298+
.PCRE2_MAX_VARLOOKBEHIND = 255,
300299
.PCRE2_PARENS_NEST_LIMIT = 250,
300+
.PCRE2_HEAP_LIMIT = 20000000,
301301
.PCRE2_MATCH_LIMIT = 10000000,
302302
.PCRE2_MATCH_LIMIT_DEPTH = "MATCH_LIMIT",
303-
.NEWLINE_DEFAULT = 2,
304-
.BSR_ANYCRLF = 0,
305-
.PCRE2GREP_BUFSIZE = 20480,
306-
.PCRE2GREP_MAX_BUFSIZE = 1048576,
303+
.PCRE2GREP_BUFSIZE = {},
304+
.PCRE2GREP_MAX_BUFSIZE = {},
307305
},
308306
));
309307
pcre2.addIncludePath(libgit_src.path("deps/pcre2"));
@@ -314,6 +312,11 @@ pub fn build(b: *std.Build) !void {
314312
"-Wno-unused-function",
315313
"-Wno-implicit-fallthrough",
316314
"-DHAVE_CONFIG_H",
315+
"-DPCRE2_CODE_UNIT_WIDTH=8",
316+
"-DPCRE2_STATIC",
317+
"-DPCRE2_EXPORT=",
318+
"-DPCRE2_EXP_DECL=",
319+
"-DPCRE2_EXP_DEFN=",
317320
},
318321
});
319322

‎build/sources.zon‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@
215215
"pcre2_error.c",
216216
"pcre2_extuni.c",
217217
"pcre2_find_bracket.c",
218-
"pcre2_fuzzsupport.c",
219218
"pcre2_maketables.c",
220219
"pcre2_match.c",
221220
"pcre2_match_data.c",

0 commit comments

Comments
 (0)