@@ -48,12 +48,12 @@ pub fn build(b: *std.Build) void {
4848 zstd .installHeader (upstream .path ("lib/zstd.h" ), "zstd.h" );
4949 zstd .installHeader (upstream .path ("lib/zdict.h" ), "zdict.h" );
5050 zstd .installHeader (upstream .path ("lib/zstd_errors.h" ), "zstd_errors.h" );
51- if (compression ) zstd .addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = compression_sources });
52- if (decompression ) zstd .addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = decompress_sources });
53- if (dictbuilder ) zstd .addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = dict_builder_sources });
54- if (deprecated ) zstd .addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = deprecated_sources });
51+ if (compression ) zstd .root_module . addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = compression_sources });
52+ if (decompression ) zstd .root_module . addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = decompress_sources });
53+ if (dictbuilder ) zstd .root_module . addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = dict_builder_sources });
54+ if (deprecated ) zstd .root_module . addCSourceFiles (.{ .root = upstream .path ("lib" ), .files = deprecated_sources });
5555 if (legacy_support != 0 ) {
56- for (legacy_support .. 8) | i | zstd .addCSourceFile (.{ .file = upstream .path (b .fmt ("lib/legacy/zstd_v0{d}.c" , .{i })) });
56+ for (legacy_support .. 8) | i | zstd .root_module . addCSourceFile (.{ .file = upstream .path (b .fmt ("lib/legacy/zstd_v0{d}.c" , .{i })) });
5757 }
5858
5959 if (target .result .cpu .arch == .x86_64 ) {
@@ -110,9 +110,9 @@ pub fn build(b: *std.Build) void {
110110 .optimize = optimize ,
111111 }),
112112 });
113- exe .addCSourceFile (.{ .file = upstream .path (b .fmt ("examples/{s}.c" , .{name })) });
114- exe .addIncludePath (upstream .path ("examples/common.c" ));
115- exe .linkLibrary (zstd );
113+ exe .root_module . addCSourceFile (.{ .file = upstream .path (b .fmt ("examples/{s}.c" , .{name })) });
114+ exe .root_module . addIncludePath (upstream .path ("examples/common.c" ));
115+ exe .root_module . linkLibrary (zstd );
116116 b .getInstallStep ().dependOn (& b .addInstallArtifact (exe , .{ .dest_dir = .{ .override = .{ .custom = "examples" } } }).step );
117117 }
118118 }
0 commit comments