mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
langref: minor documentation fixes to addCSourceFile (#16785)
This commit is contained in:
parent
fd830b146d
commit
f1992a39a5
1 changed files with 8 additions and 8 deletions
|
|
@ -10819,11 +10819,11 @@ pub fn build(b: *std.Build) void {
|
|||
|
||||
{#header_open|Compiling C Source Code#}
|
||||
<pre>{#syntax#}
|
||||
lib.addCSourceFile("src/lib.c", &[_][]const u8{
|
||||
lib.addCSourceFile(.{ .file = .{ .path = "src/lib.c" }, .flags = &.{
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Werror",
|
||||
});
|
||||
} });
|
||||
{#endsyntax#}</pre>
|
||||
{#header_close#}
|
||||
|
||||
|
|
@ -11180,7 +11180,7 @@ pub fn build(b: *std.Build) void {
|
|||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
});
|
||||
exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
|
||||
exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99"} });
|
||||
exe.linkLibrary(lib);
|
||||
exe.linkSystemLibrary("c");
|
||||
|
||||
|
|
@ -11247,10 +11247,10 @@ pub fn build(b: *std.Build) void {
|
|||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
});
|
||||
exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
|
||||
exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99",} });
|
||||
exe.addObject(obj);
|
||||
exe.linkSystemLibrary("c");
|
||||
exe.install();
|
||||
b.installArtifact(exe);
|
||||
}
|
||||
{#code_end#}
|
||||
{#shell_samp#}$ zig build
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue