@@ -36,6 +36,16 @@ pub fn build(b: *std.Build) void {
36
36
.optimize = optimize ,
37
37
});
38
38
39
+ // main wallet
40
+ const walle = b .addExecutable (.{
41
+ .name = "walle" ,
42
+ // In this case the main source file is merely a path, however, in more
43
+ // complicated build scripts, this could be a generated file.
44
+ .root_source_file = b .path ("src/walle.zig" ),
45
+ .target = target ,
46
+ .optimize = optimize ,
47
+ });
48
+
39
49
const crypto = b .addModule ("crypto" , .{
40
50
.root_source_file = b .path ("src/crypto/crypto.zig" ),
41
51
});
@@ -53,24 +63,33 @@ pub fn build(b: *std.Build) void {
53
63
wbx .root_module .addImport ("base58" , base58_module );
54
64
wbx .root_module .addImport ("crypto" , crypto );
55
65
66
+ walle .root_module .addImport ("base58" , base58_module );
67
+ walle .root_module .addImport ("clap" , clap_module );
68
+ walle .root_module .addImport ("crypto" , crypto );
69
+ walle .linkLibrary (sqlite .artifact ("sqlite" ));
70
+ walle .root_module .addImport ("sqlite" , sqlite_module );
71
+
56
72
// This declares intent for the executable to be installed into the
57
73
// standard location when the user invokes the "install" step (the default
58
74
// step when running `zig build`).
59
75
b .installArtifact (indexer );
60
76
b .installArtifact (wbx );
77
+ b .installArtifact (walle );
61
78
62
79
// This *creates* a Run step in the build graph, to be executed when another
63
80
// step is evaluated that depends on it. The next line below will establish
64
81
// such a dependency.
65
82
const run_cmd_indexer = b .addRunArtifact (indexer );
66
83
const run_cmd_wbx = b .addRunArtifact (wbx );
84
+ const run_cmd_walle = b .addRunArtifact (walle );
67
85
68
86
// By making the run step depend on the install step, it will be run from the
69
87
// installation directory rather than directly from within the cache directory.
70
88
// This is not necessary, however, if the application depends on other installed
71
89
// files, this ensures they will be present and in the expected location.
72
90
run_cmd_indexer .step .dependOn (b .getInstallStep ());
73
91
run_cmd_wbx .step .dependOn (b .getInstallStep ());
92
+ run_cmd_walle .step .dependOn (b .getInstallStep ());
74
93
75
94
// This allows the user to pass arguments to the application in the build
76
95
// command itself, like this: `zig build run -- arg1 arg2 etc`
@@ -88,6 +107,9 @@ pub fn build(b: *std.Build) void {
88
107
const run_step_wbx = b .step ("run_wbx" , "Run the walle bitcoin explorer" );
89
108
run_step_wbx .dependOn (& run_cmd_wbx .step );
90
109
110
+ const run_step_walle = b .step ("run_walle" , "Run the walle main bitcoin" );
111
+ run_step_walle .dependOn (& run_cmd_walle .step );
112
+
91
113
// Similar to creating the run step earlier, this exposes a `test` step to
92
114
// the `zig build --help` menu, providing a way for the user to request
93
115
// running the unit tests.
0 commit comments