@@ -39,31 +39,31 @@ pub fn build(b: *std.Build) void {
39
39
.name = "capstone" ,
40
40
.kind = .lib ,
41
41
.linkage = if (shared ) .dynamic else .static ,
42
- .root_module = .{
42
+ .root_module = b . createModule ( .{
43
43
.target = target ,
44
44
.optimize = optimize ,
45
45
.pic = pic ,
46
46
.strip = strip ,
47
47
.link_libc = true ,
48
- },
48
+ }) ,
49
49
});
50
50
b .installArtifact (capstone );
51
51
capstone .addIncludePath (upstream .path ("include" ));
52
52
capstone .installHeadersDirectory (upstream .path ("include/capstone" ), "capstone" , .{});
53
53
capstone .installHeader (upstream .path ("include/platform.h" ), "capstone/platform.h" );
54
54
capstone .addCSourceFiles (.{ .root = upstream .path ("" ), .files = common_sources });
55
55
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" , "" );
62
62
63
63
var it = supported_architectures .iterator ();
64
64
while (it .next ()) | key | {
65
65
// 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 ()}), "" );
67
67
capstone .addCSourceFiles (.{
68
68
.root = upstream .path (b .fmt ("arch/{s}" , .{key .subdirectory ()})),
69
69
.files = key .sources (),
0 commit comments