3ca027ca82
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`, `zig build_lib` and `zig build_exe` respectively. * `--name` parameter is optional when it can be inferred from the root source filename. closes #207 * `zig build` now looks for `build.zig` which interacts with `std.build.Builder` to describe the targets, and then the zig build system prints TODO: build these targets. See #204 * add `@bitcast` which is mainly used for pointer reinterpret casting and make explicit casting not do pointer reinterpretation. Closes #290 * fix debug info for byval parameters * sort command line help options * `std.debug.panic` supports format string printing * add `std.mem.IncrementingAllocator` * fix const ptr to a variable with data changing at runtime. closes #289
19 lines
542 B
Zig
19 lines
542 B
Zig
const root = @import("@build");
|
|
const std = @import("std");
|
|
const io = std.io;
|
|
const Builder = std.build.Builder;
|
|
const mem = std.mem;
|
|
|
|
pub fn main(args: [][]u8) -> %void {
|
|
const zig_exe = args[1];
|
|
const leftover_args = args[2...];
|
|
|
|
// TODO use a more general purpose allocator here
|
|
var inc_allocator = %%mem.IncrementingAllocator.init(10 * 1024 * 1024);
|
|
defer inc_allocator.deinit();
|
|
|
|
var builder = Builder.init(zig_exe, &inc_allocator.allocator);
|
|
root.build(&builder);
|
|
%return builder.make(leftover_args);
|
|
}
|