fix documentation regarding mixing object files

closes #2905
This commit is contained in:
Andrew Kelley 2019-07-16 11:50:34 -04:00
parent 9a9a7daef0
commit 92e781baa1
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -9210,20 +9210,16 @@ const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
const obj = b.addObject("base64", "base64.zig");
const exe = b.addCExecutable("test");
exe.addCompileFlags([_][]const u8 {
"-std=c99",
});
exe.addSourceFile("test.c");
const exe = b.addExecutable("test", null);
exe.addCSourceFile("test.c", [_][]const u8{"-std=c99"});
exe.addObject(obj);
exe.setOutputPath(".");
b.default_step.dependOn(&exe.step);
exe.linkSystemLibrary("c");
exe.install();
}
{#code_end#}
<p class="file">terminal</p>
<pre><code class="shell">$ zig build
$ ./test
$ ./zig-cache/bin/test
all your base are belong to us</code></pre>
{#see_also|Targets|Zig Build System#}
{#header_close#}