File tree 7 files changed +10
-37
lines changed
7 files changed +10
-37
lines changed Original file line number Diff line number Diff line change 1
1
const Builder = @import ("std" ).build .Builder ;
2
2
3
3
pub fn build (b : & Builder ) {
4
- const exe = b .addCExecutable ("main" );
5
- b .addCIncludePath ("." );
6
- exe .addCompileFlags ([][]const u8 {
7
- "-std=c99" ,
8
- "-nostdlib" ,
9
- });
10
-
11
- const source_files = [][]const u8 {
12
- "main.c" ,
13
- };
14
-
15
- for (source_files ) | source | {
16
- exe .addSourceFile (source );
17
- }
18
-
19
- const zig_source_files = [][]const u8 {
20
- "compute.zig" ,
21
- "compute_helper.zig" ,
22
- "display.zig" ,
23
- };
24
-
25
- for (zig_source_files ) | source | {
26
- const object = b .addObject (source , source );
27
- exe .addObject (object );
28
- }
4
+ const exe = b .addExecutable ("main" , "main.zig" );
29
5
30
6
exe .setOutputPath ("./main" );
31
7
b .default_step .dependOn (& exe .step );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- pub use @import ("compute_helper.zig" );
1
+ use @import ("compute_helper.zig" );
2
2
3
- export fn compute (a : u8 ) - > u8 {
3
+ pub fn compute (a : u8 ) - > u8 {
4
4
compute_helper (a ) + 5
5
5
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
const std = @import ("std" );
2
2
const printf = std .io .stdout .printf ;
3
3
4
- export fn display_char (c : u8 )
4
+ pub fn display_char (c : u8 )
5
5
{
6
6
%% printf ("{c}\n " , c );
7
7
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ use @import ("display.zig" );
2
+ use @import ("compute.zig" );
3
+
4
+ pub fn main () - > % void {
5
+ display_char (compute ('A' ));
6
+ }
You can’t perform that action at this time.
0 commit comments