authorgravatar for prakash.nitin63@gmail.comNitin Prakash <prakash.nitin63@gmail.com> 2023-08-17 01:05:58+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-08-16 15:35:58-04:00
logf1992a39a59b941f397b8501a525b38e5863a527
tree0f3765d68944709483331a2b8e94ba161fc8b92c
parentfd830b146dc733657aeb689e1321556395560bfd
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

langref: minor documentation fixes to addCSourceFile (#16785)


1 files changed, 8 insertions(+), 8 deletions(-)

doc/langref.html.in+8-8
...@@ -10819,11 +10819,11 @@ pub fn build(b: *std.Build) void {...@@ -10819,11 +10819,11 @@ pub fn build(b: *std.Build) void {
1081910819
10820 {#header_open|Compiling C Source Code#}10820 {#header_open|Compiling C Source Code#}
10821 <pre>{#syntax#}10821 <pre>{#syntax#}
10822lib.addCSourceFile("src/lib.c", &[_][]const u8{10822lib.addCSourceFile(.{ .file = .{ .path = "src/lib.c" }, .flags = &.{
10823 "-Wall",10823 "-Wall",
10824 "-Wextra",10824 "-Wextra",
10825 "-Werror",10825 "-Werror",
10826});10826 } });
10827 {#endsyntax#}</pre>10827 {#endsyntax#}</pre>
10828 {#header_close#}10828 {#header_close#}
1082910829
...@@ -11180,7 +11180,7 @@ pub fn build(b: *std.Build) void {...@@ -11180,7 +11180,7 @@ pub fn build(b: *std.Build) void {
11180 const exe = b.addExecutable(.{11180 const exe = b.addExecutable(.{
11181 .name = "test",11181 .name = "test",
11182 });11182 });
11183 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});11183 exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99"} });
11184 exe.linkLibrary(lib);11184 exe.linkLibrary(lib);
11185 exe.linkSystemLibrary("c");11185 exe.linkSystemLibrary("c");
1118611186
...@@ -11247,10 +11247,10 @@ pub fn build(b: *std.Build) void {...@@ -11247,10 +11247,10 @@ pub fn build(b: *std.Build) void {
11247 const exe = b.addExecutable(.{11247 const exe = b.addExecutable(.{
11248 .name = "test",11248 .name = "test",
11249 });11249 });
11250 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});11250 exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99",} });
11251 exe.addObject(obj);11251 exe.addObject(obj);
11252 exe.linkSystemLibrary("c");11252 exe.linkSystemLibrary("c");
11253 exe.install();11253 b.installArtifact(exe);
11254}11254}
11255 {#code_end#}11255 {#code_end#}
11256 {#shell_samp#}$ zig build11256 {#shell_samp#}$ zig build