Skip to content

Commit

Permalink
Fix: remove target field
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Jan 5, 2024
1 parent a3685a8 commit 5f478de
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ pub const Backend = enum {
};

pub const LibSokolOptions = struct {
optimize: OptimizeMode,
target: CrossTarget,
optimize: OptimizeMode = .Debug,
backend: Backend = .auto,
force_egl: bool = false,
enable_x11: bool = true,
Expand Down Expand Up @@ -54,7 +53,7 @@ pub fn buildSokol(b: *Builder, target: CrossTarget, optimize: OptimizeMode, opti
"sokol_shape.c",
};
var _backend = options.backend;
const is_wasm = options.target.result.isWasm();
const is_wasm = lib.rootModuleTarget().isWasm();

if (_backend == .auto) {
if (lib.rootModuleTarget().isDarwin()) {
Expand All @@ -63,8 +62,6 @@ pub fn buildSokol(b: *Builder, target: CrossTarget, optimize: OptimizeMode, opti
_backend = .d3d11;
} else if (lib.rootModuleTarget().abi == .android) {
_backend = .gles3;
// } else if (is_wasm and lib.rootModuleTarget().query.os_tag == .emscripten) {
// _backend = .wgpu;
} else {
_backend = .gl;
}
Expand Down Expand Up @@ -236,10 +233,8 @@ pub fn build(b: *Builder) !void {

const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const sokol = buildSokol(b, target, optimize, options, "");

options.target = target;
options.optimize = optimize;
const sokol = buildSokol(b, target, optimize, options, "");

const examples = .{
"clear",
Expand Down

0 comments on commit 5f478de

Please sign in to comment.