aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Ross <tristan.ross@midstall.com>2024-03-15 09:59:58 -0700
committerGitHub <noreply@github.com>2024-03-15 16:59:58 +0000
commit3c5ca5c1eabf64e1e0912b6c9eaa18850d4c3b40 (patch)
tree70cccea8afed38518f9614b6d7576e921317765f
parenta8d79d19a865c684db9d2a09347d5d8034b47133 (diff)
downloadpcre-3c5ca5c1eabf64e1e0912b6c9eaa18850d4c3b40.tar.gz
Update build.zig to support latest master (#395)
-rw-r--r--build.zig55
1 files changed, 27 insertions, 28 deletions
diff --git a/build.zig b/build.zig
index 7238069c..b554b0ea 100644
--- a/build.zig
+++ b/build.zig
@@ -9,7 +9,7 @@ pub const CodeUnitWidth = enum {
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
- const linkage = b.option(std.Build.Step.Compile.Linkage, "linkage", "whether to statically or dynamically link the library") orelse .static;
+ const linkage = b.option(std.builtin.LinkMode, "linkage", "whether to statically or dynamically link the library") orelse @as(std.builtin.LinkMode, if (target.result.isGnuLibC()) .dynamic else .static);
const codeUnitWidth = b.option(CodeUnitWidth, "code-unit-width", "Sets the code unit width") orelse .@"8";
const copyFiles = b.addWriteFiles();
@@ -45,36 +45,35 @@ pub fn build(b: *std.Build) !void {
lib.addCSourceFiles(.{
.files = &.{
- b.pathFromRoot("src/pcre2_auto_possess.c"),
- b.pathFromRoot("src/pcre2_chkdint.c"),
- b.pathFromRoot("src/pcre2_compile.c"),
- b.pathFromRoot("src/pcre2_config.c"),
- b.pathFromRoot("src/pcre2_context.c"),
- b.pathFromRoot("src/pcre2_convert.c"),
- b.pathFromRoot("src/pcre2_dfa_match.c"),
- b.pathFromRoot("src/pcre2_error.c"),
- b.pathFromRoot("src/pcre2_extuni.c"),
- b.pathFromRoot("src/pcre2_find_bracket.c"),
- b.pathFromRoot("src/pcre2_maketables.c"),
- b.pathFromRoot("src/pcre2_match.c"),
- b.pathFromRoot("src/pcre2_match_data.c"),
- b.pathFromRoot("src/pcre2_newline.c"),
- b.pathFromRoot("src/pcre2_ord2utf.c"),
- b.pathFromRoot("src/pcre2_pattern_info.c"),
- b.pathFromRoot("src/pcre2_script_run.c"),
- b.pathFromRoot("src/pcre2_serialize.c"),
- b.pathFromRoot("src/pcre2_string_utils.c"),
- b.pathFromRoot("src/pcre2_study.c"),
- b.pathFromRoot("src/pcre2_substitute.c"),
- b.pathFromRoot("src/pcre2_substring.c"),
- b.pathFromRoot("src/pcre2_tables.c"),
- b.pathFromRoot("src/pcre2_ucd.c"),
- b.pathFromRoot("src/pcre2_valid_utf.c"),
- b.pathFromRoot("src/pcre2_xclass.c"),
+ "src/pcre2_auto_possess.c",
+ "src/pcre2_chkdint.c",
+ "src/pcre2_compile.c",
+ "src/pcre2_config.c",
+ "src/pcre2_context.c",
+ "src/pcre2_convert.c",
+ "src/pcre2_dfa_match.c",
+ "src/pcre2_error.c",
+ "src/pcre2_extuni.c",
+ "src/pcre2_find_bracket.c",
+ "src/pcre2_maketables.c",
+ "src/pcre2_match.c",
+ "src/pcre2_match_data.c",
+ "src/pcre2_newline.c",
+ "src/pcre2_ord2utf.c",
+ "src/pcre2_pattern_info.c",
+ "src/pcre2_script_run.c",
+ "src/pcre2_serialize.c",
+ "src/pcre2_string_utils.c",
+ "src/pcre2_study.c",
+ "src/pcre2_substitute.c",
+ "src/pcre2_substring.c",
+ "src/pcre2_tables.c",
+ "src/pcre2_ucd.c",
+ "src/pcre2_valid_utf.c",
+ "src/pcre2_xclass.c",
},
.flags = &.{
"-DHAVE_CONFIG_H",
- "-DPCRE2_CODE_UNIT_WIDTH=8",
"-DPCRE2_STATIC",
},
});