Skip to content

Commit 3f61efd

Browse files
authored
Merge pull request #27 from Mishieck/chore-use-zig-0.15.1
chore: use zig 0.15.1
2 parents 04224f0 + 0a496fd commit 3f61efd

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.github/workflows/zig.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ jobs:
88
tests:
99
strategy:
1010
matrix:
11-
zig-version: ["0.14.0"]
12-
runs-on: ["ubuntu-latest", "macos-13", "macos-latest", "windows-latest"]
11+
zig-version: ["0.15.1"]
12+
runs-on: ["ubuntu-latest", "macos-latest", "windows-latest"]
1313
runs-on: ${{ matrix.runs-on }}
1414
steps:
15-
- uses: actions/checkout@v4
16-
- uses: goto-bus-stop/setup-zig@2a9625d550eefc3a9b1a43d342ad655f563f8241
15+
- uses: actions/checkout@v6
16+
- uses: mlugg/setup-zig@v2
1717
with:
1818
version: ${{ matrix.zig-version }}
1919
- run: zig build
2020
- run: zig build test
2121
lint:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v6
2525
with:
2626
submodules: recursive
27-
- uses: goto-bus-stop/setup-zig@v1
27+
- uses: mlugg/setup-zig@v2
2828
with:
29-
version: 0.14.0
29+
version: 0.15.1
3030
- run: zig fmt --check build.zig src/*.zig

build.zig

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ const builtin = @import("builtin");
44
pub fn build(b: *std.Build) !void {
55
const optimize = b.standardOptimizeOption(.{});
66
const target = b.standardTargetOptions(.{});
7-
const use_system = b.option(bool, "system_library", "link against libpcre from the system instead of source build") orelse false;
7+
8+
const use_system = b.option(
9+
bool,
10+
"system_library",
11+
"link against libpcre from the system instead of source build",
12+
) orelse false;
13+
814
const pcre_dep = b.dependency("pcre", .{
915
.optimize = optimize,
1016
.target = target,
@@ -18,20 +24,20 @@ pub fn build(b: *std.Build) !void {
1824
});
1925
try linkPcre(b, mod, libpcre, use_system);
2026

21-
const lib = b.addStaticLibrary(.{
27+
const lib = b.addLibrary(.{
2228
.name = "libpcre.zig",
23-
.root_source_file = b.path("src/main.zig"),
24-
.target = target,
25-
.optimize = optimize,
29+
.root_module = b.createModule(.{
30+
.root_source_file = b.path("src/main.zig"),
31+
.target = target,
32+
.optimize = optimize,
33+
}),
2634
});
2735
try linkPcre(b, lib.root_module, libpcre, use_system);
2836
b.installArtifact(lib);
2937

3038
const main_tests = b.addTest(.{
3139
.name = "main_tests",
32-
.root_source_file = b.path("src/main.zig"),
33-
.optimize = optimize,
34-
.target = target,
40+
.root_module = mod,
3541
});
3642
try linkPcre(b, main_tests.root_module, libpcre, use_system);
3743

build.zig.zon

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
.version = "0.1.0",
44
.dependencies = .{
55
.pcre = .{
6-
.url = "https://github.com/kivikakk/pcre-8.45/archive/6a08aa250b3ca1deea5fbc5f696bb4e25ac2da90.tar.gz",
7-
.hash = "pcre-8.45.0-AAAAAN3FlADQe8mToDeNIJ0RXIk30ytiW7cNOsnvmXXv",
6+
.url = "git+https://github.com/kivikakk/pcre-8.45.git#824efc4ed764ec41cbff54f61a0464a53a6f5350",
7+
.hash = "pcre-8.45.0-HTSBAQ3GlACATeP1fwTiNwB0B-4F81hDsArROAnP7nwX",
88
},
99
},
1010
.fingerprint = 0xc2f976f309fad70e,
11-
.minimum_zig_version = "0.14.0",
11+
.minimum_zig_version = "0.15.1",
1212
.paths = .{
1313
"build.zig",
1414
"build.zig.zon",

0 commit comments

Comments
 (0)