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 {
1081910819
1082010820 {#header_open|Compiling C Source Code#}
1082110821 <pre>{#syntax#}
10822lib.addCSourceFile("src/lib.c", &[_][]const u8{
10823 "-Wall",
10824 "-Wextra",
10825 "-Werror",
10826});
10822lib.addCSourceFile(.{ .file = .{ .path = "src/lib.c" }, .flags = &.{
10823 "-Wall",
10824 "-Wextra",
10825 "-Werror",
10826 } });
1082710827 {#endsyntax#}</pre>
1082810828 {#header_close#}
1082910829
......@@ -11180,7 +11180,7 @@ pub fn build(b: *std.Build) void {
1118011180 const exe = b.addExecutable(.{
1118111181 .name = "test",
1118211182 });
11183 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
11183 exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99"} });
1118411184 exe.linkLibrary(lib);
1118511185 exe.linkSystemLibrary("c");
1118611186
......@@ -11247,10 +11247,10 @@ pub fn build(b: *std.Build) void {
1124711247 const exe = b.addExecutable(.{
1124811248 .name = "test",
1124911249 });
11250 exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});
11250 exe.addCSourceFile(.{ .file = .{ .path = "test.c" }, .flags = &.{"-std=c99",} });
1125111251 exe.addObject(obj);
1125211252 exe.linkSystemLibrary("c");
11253 exe.install();
11253 b.installArtifact(exe);
1125411254}
1125511255 {#code_end#}
1125611256 {#shell_samp#}$ zig build