@@ -14,12 +14,12 @@ pub fn build(b: *std.Build) void {
14
14
});
15
15
const libpotrace_flags = .{ "-std=gnu17" , "-DHAVE_CONFIG_H" };
16
16
libpotrace .linkLibC ();
17
- libpotrace .addIncludePath (.{ . path = "lib/potrace-1.16/src" } );
18
- libpotrace .addIncludePath (.{ . path = "lib/potrace-config" } );
19
- libpotrace .addCSourceFile (.{ .file = .{ . path = "lib/potrace-1.16/src/curve.c" } , .flags = & libpotrace_flags });
20
- libpotrace .addCSourceFile (.{ .file = .{ . path = "lib/potrace-1.16/src/trace.c" } , .flags = & libpotrace_flags });
21
- libpotrace .addCSourceFile (.{ .file = .{ . path = "lib/potrace-1.16/src/decompose.c" } , .flags = & libpotrace_flags });
22
- libpotrace .addCSourceFile (.{ .file = .{ . path = "lib/potrace-1.16/src/potracelib.c" } , .flags = & libpotrace_flags });
17
+ libpotrace .addIncludePath (b . path ( "lib/potrace-1.16/src" ) );
18
+ libpotrace .addIncludePath (b . path ( "lib/potrace-config" ) );
19
+ libpotrace .addCSourceFile (.{ .file = b . path ( "lib/potrace-1.16/src/curve.c" ) , .flags = & libpotrace_flags });
20
+ libpotrace .addCSourceFile (.{ .file = b . path ( "lib/potrace-1.16/src/trace.c" ) , .flags = & libpotrace_flags });
21
+ libpotrace .addCSourceFile (.{ .file = b . path ( "lib/potrace-1.16/src/decompose.c" ) , .flags = & libpotrace_flags });
22
+ libpotrace .addCSourceFile (.{ .file = b . path ( "lib/potrace-1.16/src/potracelib.c" ) , .flags = & libpotrace_flags });
23
23
24
24
const libclipper2 = b .addStaticLibrary (.{
25
25
.name = "clipper2" ,
@@ -30,54 +30,47 @@ pub fn build(b: *std.Build) void {
30
30
const libclipper2_flags = .{ "-std=gnu++17" , "-fno-exceptions" , "-Dthrow=abort" };
31
31
libclipper2 .linkLibC ();
32
32
libclipper2 .linkSystemLibrary ("c++" );
33
- libclipper2 .addIncludePath (.{ . path = "lib/clipper2/CPP/Clipper2Lib" } );
34
- libclipper2 .addIncludePath (.{ . path = "src" } );
33
+ libclipper2 .addIncludePath (b . path ( "lib/clipper2/CPP/Clipper2Lib" ) );
34
+ libclipper2 .addIncludePath (b . path ( "src" ) );
35
35
libclipper2 .addCSourceFile (.{
36
- .file = .{ . path = "lib/clipper2/CPP/Clipper2Lib/clipper.engine.cpp" } ,
36
+ .file = b . path ( "lib/clipper2/CPP/Clipper2Lib/clipper.engine.cpp" ) ,
37
37
.flags = & libclipper2_flags ,
38
38
});
39
39
libclipper2 .addCSourceFile (.{
40
- .file = .{ . path = "lib/clipper2/CPP/Clipper2Lib/clipper.offset.cpp" } ,
40
+ .file = b . path ( "lib/clipper2/CPP/Clipper2Lib/clipper.offset.cpp" ) ,
41
41
.flags = & libclipper2_flags ,
42
42
});
43
43
libclipper2 .addCSourceFile (.{
44
- .file = .{ . path = "src/clipperwrapper.cpp" } ,
44
+ .file = b . path ( "src/clipperwrapper.cpp" ) ,
45
45
.flags = & libclipper2_flags ,
46
46
});
47
47
48
- const libgingerbread = b .addExecutable (.{
49
- .name = "gingerbread" ,
50
- .root_source_file = .{ .path = "src/gingerbread.zig" },
51
- .version = .{ .major = 1 , .minor = 0 , .patch = 0 },
52
- .target = target ,
53
- .optimize = optimize ,
54
- .strip = true
55
- });
48
+ const libgingerbread = b .addExecutable (.{ .name = "gingerbread" , .root_source_file = b .path ("src/gingerbread.zig" ), .version = .{ .major = 1 , .minor = 0 , .patch = 0 }, .target = target , .optimize = optimize , .strip = true });
56
49
libgingerbread .entry = .disabled ;
57
50
libgingerbread .rdynamic = true ;
58
51
libgingerbread .wasi_exec_model = std .builtin .WasiExecModel .reactor ;
59
52
libgingerbread .linkLibC ();
60
53
libgingerbread .linkLibrary (libpotrace );
61
54
libgingerbread .linkLibrary (libclipper2 );
62
- libgingerbread .addIncludePath (.{ . path = "src" } );
63
- libgingerbread .addIncludePath (.{ . path = "lib/potrace-1.16/src" } );
55
+ libgingerbread .addIncludePath (b . path ( "src" ) );
56
+ libgingerbread .addIncludePath (b . path ( "lib/potrace-1.16/src" ) );
64
57
65
58
b .installArtifact (libgingerbread );
66
59
67
60
// const main = b.addTest(.{
68
61
// .name = "main",
69
- // .root_source_file = .{ . path = "src/tests.zig" } ,
62
+ // .root_source_file = b. path( "src/tests.zig") ,
70
63
// .target = target,
71
64
// .optimize = optimize,
72
65
// .link_libc = true,
73
66
// });
74
67
// main.linkLibrary(libpotrace);
75
68
// main.linkLibrary(libclipper2);
76
- // main.addIncludePath(.{ . path = "src/" } );
77
- // main.addIncludePath(.{ . path = "lib/potrace-1.16/src" } );
78
- // main.addIncludePath(.{ . path = "lib/potrace-config" } );
79
- // main.addIncludePath(.{ . path = "lib/stb" } );
80
- // main.addCSourceFile(.{ .file = .{ . path = "src/load_image.c" } , .flags = &.{
69
+ // main.addIncludePath(b. path( "src/") );
70
+ // main.addIncludePath(b. path( "lib/potrace-1.16/src") );
71
+ // main.addIncludePath(b. path( "lib/potrace-config") );
72
+ // main.addIncludePath(b. path( "lib/stb") );
73
+ // main.addCSourceFile(.{ .file = b. path( "src/load_image.c") , .flags = &.{
81
74
// "-std=gnu17",
82
75
// } });
83
76
0 commit comments