11pub const version = "0.0.0-pre1" ;
22
3+ pub const MakeFirm = @import ("build/MakeFirm.zig" );
34pub const Make3dsx = @import ("build/Make3dsx.zig" );
45pub const MakeSmdh = @import ("build/MakeSmdh.zig" );
56pub const MakeRomFs = @import ("build/MakeRomFs.zig" );
@@ -47,8 +48,6 @@ pub const target = struct {
4748};
4849
4950pub fn build (b : * Build ) void {
50- const release = b .option (bool , "release" , "Perform a release build" ) orelse false ;
51-
5251 const optimize = b .standardOptimizeOption (.{});
5352 const tools_target = b .standardTargetOptions (.{});
5453
@@ -79,10 +78,7 @@ pub fn build(b: *Build) void {
7978
8079 zitrus .addImport ("zitrus" , zitrus );
8180
82- if (release ) {
83- buildReleases (b , config , zdap , zigimg , zitrus );
84- return ;
85- }
81+ makeReleaseStep (b , optimize , config , zdap , zigimg , zitrus );
8682
8783 // XXX: Yes, this is really needed for each target / optimize...
8884 const zitrus_lib = b .addLibrary (.{
@@ -147,22 +143,32 @@ pub fn build(b: *Build) void {
147143}
148144
149145const release_targets : []const std.Target.Query = &.{
146+ // Everyone is welcome to the party!
147+ // NOTE: Even if your platform is not included here it may be supported if zig supports it.
150148 .{ .cpu_arch = .x86 , .os_tag = .linux },
151149 .{ .cpu_arch = .x86 , .os_tag = .windows },
150+ .{ .cpu_arch = .x86 , .os_tag = .netbsd },
152151 .{ .cpu_arch = .x86_64 , .os_tag = .linux },
153152 .{ .cpu_arch = .x86_64 , .os_tag = .windows },
154153 .{ .cpu_arch = .x86_64 , .os_tag = .macos },
155154 .{ .cpu_arch = .x86_64 , .os_tag = .freebsd },
155+ .{ .cpu_arch = .x86_64 , .os_tag = .netbsd },
156+ .{ .cpu_arch = .arm , .os_tag = .linux },
157+ .{ .cpu_arch = .arm , .os_tag = .freebsd },
158+ .{ .cpu_arch = .arm , .os_tag = .netbsd },
156159 .{ .cpu_arch = .aarch64 , .os_tag = .linux },
157160 .{ .cpu_arch = .aarch64 , .os_tag = .windows },
158161 .{ .cpu_arch = .aarch64 , .os_tag = .macos },
159162 .{ .cpu_arch = .aarch64 , .os_tag = .freebsd },
163+ .{ .cpu_arch = .aarch64 , .os_tag = .netbsd },
160164 .{ .cpu_arch = .riscv64 , .os_tag = .linux },
161165};
162166
163- fn buildReleases (b : * Build , config : * Build.Step.Options , zdap : * Build.Module , zigimg : * Build.Module , zitrus : * Build.Module ) void {
167+ fn makeReleaseStep (b : * Build , optimize : std.builtin.OptimizeMode , config : * Build.Step.Options , zdap : * Build.Module , zigimg : * Build.Module , zitrus : * Build.Module ) void {
168+ const release_step = b .step ("release" , "Perform a release build" );
169+
164170 for (release_targets ) | release_target | {
165- _ , const tools = buildTools (b , config , .ReleaseSafe , b .resolveTargetQuery (release_target ), zdap , zigimg , zitrus );
171+ _ , const tools = buildTools (b , config , optimize , b .resolveTargetQuery (release_target ), zdap , zigimg , zitrus );
166172
167173 tools .root_module .strip = true ;
168174
@@ -174,7 +180,7 @@ fn buildReleases(b: *Build, config: *Build.Step.Options, zdap: *Build.Module, zi
174180 },
175181 });
176182
177- b . getInstallStep () .dependOn (& tools_output .step );
183+ release_step .dependOn (& tools_output .step );
178184 }
179185}
180186
0 commit comments