forked from PCRE2Project/pcre2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
56 lines (53 loc) · 1.79 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const copyFiles = b.addWriteFiles();
copyFiles.addCopyFileToSource(.{ .path = "src/config.h.generic" }, "src/config.h");
copyFiles.addCopyFileToSource(.{ .path = "src/pcre2.h.generic" }, "src/pcre2.h");
copyFiles.addCopyFileToSource(.{ .path = "src/pcre2_chartables.c.dist" }, "src/pcre2_chartables.c");
const lib = b.addStaticLibrary(.{
.name = "pcre2",
.target = target,
.optimize = optimize,
});
lib.addIncludePath(.{ .path = "src" });
lib.addCSourceFiles(&.{
"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",
"src/pcre2_chartables.c",
}, &.{
"-std=c99",
"-DHAVE_CONFIG_H",
"-DPCRE2_CODE_UNIT_WIDTH=8",
"-DPCRE2_STATIC",
});
lib.step.dependOn(©Files.step);
lib.installHeader("src/pcre2.h.generic", "pcre2.h");
lib.linkLibC();
b.installArtifact(lib);
}