Compare commits
2 Commits
de7b29c458
...
f032509b12
Author | SHA1 | Date | |
---|---|---|---|
|
f032509b12 | ||
|
2a10ffc55c |
13
build.zig
13
build.zig
@ -3,15 +3,13 @@ const sokol = @import("sokol");
|
|||||||
|
|
||||||
const title = "sok";
|
const title = "sok";
|
||||||
|
|
||||||
const buildForWeb = false;
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) void {
|
pub fn build(b: *std.Build) void {
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
const dep_sokol = b.dependency("sokol", .{ .target = target, .optimize = optimize });
|
const dep_sokol = b.dependency("sokol", .{ .target = target, .optimize = optimize });
|
||||||
|
|
||||||
if (!buildForWeb) {
|
if (!target.result.isWasm()) {
|
||||||
// Native exe
|
// Native exe
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
const exe = b.addExecutable(.{
|
||||||
@ -96,12 +94,3 @@ pub fn build(b: *std.Build) void {
|
|||||||
const test_step = b.step("test", "Run unit tests");
|
const test_step = b.step("test", "Run unit tests");
|
||||||
test_step.dependOn(&run_exe_unit_tests.step);
|
test_step.dependOn(&run_exe_unit_tests.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for web builds, the Zig code needs to be built into a library and linked with the Emscripten linker
|
|
||||||
fn buildWeb(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.Build.OptimizeMode, dep_sokol: *std.Build.Dependency) !void {
|
|
||||||
_ = b; // autofix
|
|
||||||
_ = target; // autofix
|
|
||||||
_ = optimize; // autofix
|
|
||||||
_ = dep_sokol; // autofix
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -10,6 +10,8 @@ The goal of this project is not fixed, and is just to try out some sokol feature
|
|||||||
|
|
||||||
To build, you need to have zig master (you can use [zvm](https://www.zvm.app/) to help you with this). Then just `zig build run` and that should be it!
|
To build, you need to have zig master (you can use [zvm](https://www.zvm.app/) to help you with this). Then just `zig build run` and that should be it!
|
||||||
|
|
||||||
|
To build for wasm, use `zig build -Dtarget=wasm32-emscripten run`
|
||||||
|
|
||||||
Note that if you change shaders, you have to recompile them manually - run compile_shaders.bat.
|
Note that if you change shaders, you have to recompile them manually - run compile_shaders.bat.
|
||||||
|
|
||||||
### Live error checking
|
### Live error checking
|
||||||
|
Loading…
Reference in New Issue
Block a user