Skip to content

Commit f1bcae8

Browse files
committed
Update to zig 0.14
1 parent c6bcc8e commit f1bcae8

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

build.zig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,31 @@ pub fn build(b: *std.Build) void {
3939
.name = "capstone",
4040
.kind = .lib,
4141
.linkage = if (shared) .dynamic else .static,
42-
.root_module = .{
42+
.root_module = b.createModule(.{
4343
.target = target,
4444
.optimize = optimize,
4545
.pic = pic,
4646
.strip = strip,
4747
.link_libc = true,
48-
},
48+
}),
4949
});
5050
b.installArtifact(capstone);
5151
capstone.addIncludePath(upstream.path("include"));
5252
capstone.installHeadersDirectory(upstream.path("include/capstone"), "capstone", .{});
5353
capstone.installHeader(upstream.path("include/platform.h"), "capstone/platform.h");
5454
capstone.addCSourceFiles(.{ .root = upstream.path(""), .files = common_sources });
5555

56-
if (build_diet) capstone.defineCMacro("CAPSTONE_DIET", null);
57-
if (use_default_alloc) capstone.defineCMacro("CAPSTONE_USE_SYS_DYN_MEM", null);
58-
if (x86_reduce) capstone.defineCMacro("CAPSTONE_X86_REDUCE", null);
59-
if (x86_att_disable) capstone.defineCMacro("CAPSTONE_X86_ATT_DISABLE", null);
60-
if (osx_kernel_support) capstone.defineCMacro("CAPSTONE_HAS_OSXKERNEL", null);
61-
if (optimize == .Debug) capstone.defineCMacro("CAPSTONE_DEBUG", null);
56+
if (build_diet) capstone.root_module.addCMacro("CAPSTONE_DIET", "");
57+
if (use_default_alloc) capstone.root_module.addCMacro("CAPSTONE_USE_SYS_DYN_MEM", "");
58+
if (x86_reduce) capstone.root_module.addCMacro("CAPSTONE_X86_REDUCE", "");
59+
if (x86_att_disable) capstone.root_module.addCMacro("CAPSTONE_X86_ATT_DISABLE", "");
60+
if (osx_kernel_support) capstone.root_module.addCMacro("CAPSTONE_HAS_OSXKERNEL", "");
61+
if (optimize == .Debug) capstone.root_module.addCMacro("CAPSTONE_DEBUG", "");
6262

6363
var it = supported_architectures.iterator();
6464
while (it.next()) |key| {
6565
// std.log.info("Enabling CAPSTONE_HAS_{s}", .{key.macroName()});
66-
capstone.defineCMacro(b.fmt("CAPSTONE_HAS_{s}", .{key.macroName()}), null);
66+
capstone.root_module.addCMacro(b.fmt("CAPSTONE_HAS_{s}", .{key.macroName()}), "");
6767
capstone.addCSourceFiles(.{
6868
.root = upstream.path(b.fmt("arch/{s}", .{key.subdirectory()})),
6969
.files = key.sources(),

build.zig.zon

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
.{
2-
.name = "capstone",
2+
.name = .capstone,
33
.version = "5.0.1",
4-
.minimum_zig_version = "0.13.0",
4+
.minimum_zig_version = "0.14.0",
5+
.fingerprint = 0xc2a7c096815463b6,
56

67
.dependencies = .{
78
.capstone = .{
89
.url = "https://github.com/capstone-engine/capstone/archive/refs/tags/5.0.1.tar.gz",
9-
.hash = "12203db27899cf191689d4c4a37497e0bfb5e9e185ac8bb968792c5d138d64a75119",
10+
.hash = "N-V-__8AAOy5SwM9sniZzxkWidTEo3SX4L-16eGFrIu5aHks",
1011
},
1112
},
1213

0 commit comments

Comments
 (0)