Created
January 24, 2023 23:51
-
-
Save sortofsleepy/717b998d2cf81aa3b71500d84cfc687a to your computer and use it in GitHub Desktop.
Zig build script - passing command line value example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Builder = @import("std").build.Builder; | |
const std = @import("std"); | |
pub const OptionsStep = @import("std").build.OptionsStep; | |
pub fn build(b: *Builder) void { | |
var option = b.option(bool,"Desktop", "Set to true to build desktop focused library"); | |
if(option == true){ | |
std.log.info("TODO",.{}); | |
}else { | |
const exe = b.addExecutable("zig_gl", "src/main.zig"); | |
exe.setTarget(.{.cpu_arch = .wasm32, .os_tag = .freestanding}); | |
exe.setOutputDir("client"); | |
// finally build wasm. | |
b.default_step.dependOn(&exe.step); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment