2017-04-11 03:14:46 -07:00
|
|
|
const Builder = @import("std").build.Builder;
|
2017-05-02 14:34:21 -07:00
|
|
|
const Mode = @import("builtin").Mode;
|
2017-04-11 03:14:46 -07:00
|
|
|
|
|
|
|
pub fn build(b: &Builder) {
|
2017-05-02 14:34:21 -07:00
|
|
|
const release_safe = b.option(bool, "--release-safe", "optimizations on and safety on") ?? false;
|
|
|
|
const release_fast = b.option(bool, "--release-fast", "optimizations on and safety off") ?? false;
|
|
|
|
|
|
|
|
const build_mode = if (release_safe) {
|
|
|
|
Mode.ReleaseSafe
|
|
|
|
} else if (release_fast) {
|
|
|
|
Mode.ReleaseFast
|
|
|
|
} else {
|
|
|
|
Mode.Debug
|
|
|
|
};
|
2017-04-11 03:14:46 -07:00
|
|
|
|
2017-04-18 22:13:15 -07:00
|
|
|
const exe = b.addExecutable("YOUR_NAME_HERE", "src/main.zig");
|
2017-05-02 14:34:21 -07:00
|
|
|
exe.setBuildMode(build_mode);
|
2017-04-18 22:13:15 -07:00
|
|
|
|
|
|
|
b.default_step.dependOn(&exe.step);
|
2017-04-11 03:14:46 -07:00
|
|
|
}
|