File tree 5 files changed +17
-13
lines changed
5 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 1
- zig-cache /
2
- tetris
1
+ . zig-cache /
2
+ zig-out /
Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ pub fn build(b: *std.Build) void {
5
5
const optimize = b .standardOptimizeOption (.{});
6
6
const use_llvm = b .option (bool , "use-llvm" , "use the LLVM backend" );
7
7
8
+ const translate_c = b .addTranslateC (.{
9
+ .root_source_file = b .path ("src/c.h" ),
10
+ .target = target ,
11
+ .optimize = optimize ,
12
+ .link_libc = true ,
13
+ });
8
14
const exe = b .addExecutable (.{
9
15
.name = "tetris" ,
10
16
.root_source_file = b .path ("src/main.zig" ),
@@ -13,10 +19,10 @@ pub fn build(b: *std.Build) void {
13
19
.use_llvm = use_llvm ,
14
20
.use_lld = use_llvm ,
15
21
});
16
-
17
- exe .linkLibC ();
22
+ exe .root_module .addImport ("c" , translate_c .createModule ());
18
23
exe .linkSystemLibrary ("glfw" );
19
24
exe .linkSystemLibrary ("epoxy" );
25
+
20
26
b .installArtifact (exe );
21
27
22
28
const play = b .step ("play" , "Play the game" );
Original file line number Diff line number Diff line change
1
+ #include <stdio.h>
2
+ #include <math.h>
3
+ #include <time.h>
4
+ #include <stdlib.h>
5
+ #include <epoxy/gl.h>
6
+ #include <GLFW/glfw3.h>
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const Tetris = @import("tetris.zig").Tetris;
8
8
const std = @import ("std" );
9
9
const assert = std .debug .assert ;
10
10
const bufPrint = std .fmt .bufPrint ;
11
- const c = @import ("c.zig " );
11
+ const c = @import ("c" );
12
12
const debug_gl = @import ("debug_gl.zig" );
13
13
const AllShaders = @import ("all_shaders.zig" ).AllShaders ;
14
14
const StaticGeometry = @import ("static_geometry.zig" ).StaticGeometry ;
You can’t perform that action at this time.
0 commit comments