@@ -8,24 +8,31 @@ pub fn build(b: *std.Build) void {
88 const target = b .standardTargetOptions (.{});
99 const optimize = b .standardOptimizeOption (.{});
1010
11- const lib_mod = b .addModule ("csscolorparser" , .{ .root_source_file = b .path ("src/root.zig" ) });
11+ const csscolorparser_mod = b .addModule (
12+ "csscolorparser" ,
13+ .{ .root_source_file = b .path ("src/root.zig" ) },
14+ );
1215
1316 const unit_test_step = b .step ("unit-test" , "Run only the unit tests" );
1417 const unit_tests = b .addTest (.{
15- .root_source_file = b .path ("src/root.zig" ),
16- .target = target ,
17- .optimize = optimize ,
18+ .root_module = b .createModule (.{
19+ .root_source_file = b .path ("src/root.zig" ),
20+ .target = target ,
21+ .optimize = optimize ,
22+ }),
1823 });
1924 const run_unit_tests = b .addRunArtifact (unit_tests );
2025 unit_test_step .dependOn (& run_unit_tests .step );
2126
2227 const integration_test_step = b .step ("integration-test" , "Run only the integration tests" );
2328 const integration_tests = b .addTest (.{
24- .root_source_file = b .path ("tests/root.zig" ),
25- .target = target ,
26- .optimize = optimize ,
29+ .root_module = b .createModule (.{
30+ .root_source_file = b .path ("tests/root.zig" ),
31+ .target = target ,
32+ .optimize = optimize ,
33+ }),
2734 });
28- integration_tests .root_module .addImport ("csscolorparser" , lib_mod );
35+ integration_tests .root_module .addImport ("csscolorparser" , csscolorparser_mod );
2936 const run_integration_tests = b .addRunArtifact (integration_tests );
3037 integration_test_step .dependOn (& run_integration_tests .step );
3138
@@ -36,9 +43,11 @@ pub fn build(b: *std.Build) void {
3643 const doc_step = b .step ("doc" , "Build the package documentation" );
3744 const doc_obj = b .addObject (.{
3845 .name = "csscolorparser" ,
39- .root_source_file = b .path ("src/root.zig" ),
40- .target = target ,
41- .optimize = optimize ,
46+ .root_module = b .createModule (.{
47+ .root_source_file = b .path ("src/root.zig" ),
48+ .target = target ,
49+ .optimize = optimize ,
50+ }),
4251 });
4352 const install_doc = b .addInstallDirectory (.{
4453 .source_dir = doc_obj .getEmittedDocs (),
@@ -52,11 +61,13 @@ pub fn build(b: *std.Build) void {
5261 inline for (example_names ) | example_name | {
5362 const example = b .addExecutable (.{
5463 .name = example_name ,
55- .root_source_file = b .path ("examples/" ++ example_name ++ ".zig" ),
56- .target = target ,
57- .optimize = optimize ,
64+ .root_module = b .createModule (.{
65+ .root_source_file = b .path ("examples/" ++ example_name ++ ".zig" ),
66+ .target = target ,
67+ .optimize = optimize ,
68+ }),
5869 });
59- example .root_module .addImport ("csscolorparser" , lib_mod );
70+ example .root_module .addImport ("csscolorparser" , csscolorparser_mod );
6071 const install_example = b .addInstallArtifact (example , .{});
6172 example_step .dependOn (& example .step );
6273 example_step .dependOn (& install_example .step );
0 commit comments