File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed
Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ const Builder = @import("std").build.Builder;
22
33pub fn build (b : & Builder ) {
44 const exe = b .addCExecutable ("main" );
5+ b .addCIncludePath ("." );
56 exe .addCompileFlags ([][]const u8 {
67 "-std=c99"
78 });
89
910 const source_files = [][]const u8 {
10- "compute.c" ,
1111 "compute_helper.c" ,
1212 "display.c" ,
1313 "main.c"
@@ -17,6 +17,15 @@ pub fn build(b: &Builder) {
1717 exe .addSourceFile (source );
1818 }
1919
20+ const zig_source_files = [][]const u8 {
21+ "compute.zig" ,
22+ };
23+
24+ for (zig_source_files ) | source | {
25+ const object = b .addObject (source , source );
26+ exe .addObject (object );
27+ }
28+
2029 exe .setOutputPath ("./main" );
2130 b .default_step .dependOn (& exe .step );
2231}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ pub use @cImport (@cInclude ("compute_helper.h" ));
2+
3+ export fn compute (a : u8 ) - > u8 {
4+ compute_helper (a ) + 5
5+ }
You can’t perform that action at this time.
0 commit comments