authorgravatar for shritesh@shritesh.comShritesh Bhattarai <shritesh@shritesh.com> 2019-05-02 09:48:33-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-03 15:56:33-04:00
log2f39da7cddca3e3ae6a3c92f2a52eab77f311ccc
tree1ceacb77682b393cac05e8677b2d68a798e24ce3
parent5c04c22bcc04fba8f84fa8e5ec57482c13d0a488

docgen: show -target command line argument


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

doc/docgen.zig+10-1
......@@ -1068,6 +1068,9 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
10681068 }
10691069 if (code.target_str) |triple| {
10701070 try build_args.appendSlice([][]const u8{ "-target", triple });
1071 if (!code.is_inline) {
1072 try out.print(" -target {}", triple);
1073 }
10711074 }
10721075 if (expected_outcome == .BuildFail) {
10731076 const result = try os.ChildProcess.exec(
......@@ -1110,7 +1113,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
11101113 (builtin.os != builtin.Os.linux or builtin.arch != builtin.Arch.x86_64))
11111114 {
11121115 // skip execution
1113 try out.print("\n$ # Skipping execution because it is non-native.</code></pre>\n");
1116 try out.print("</code></pre>\n");
11141117 break :code_block;
11151118 }
11161119 }
......@@ -1174,6 +1177,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
11741177 }
11751178 if (code.target_str) |triple| {
11761179 try test_args.appendSlice([][]const u8{ "-target", triple });
1180 try out.print(" -target {}", triple);
11771181 }
11781182 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");
11791183 const escaped_stderr = try escapeHtml(allocator, result.stderr);
......@@ -1354,6 +1358,11 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
13541358 },
13551359 }
13561360
1361 if (code.target_str) |triple| {
1362 try build_args.appendSlice([][]const u8{ "-target", triple });
1363 try out.print(" -target {}", triple);
1364 }
1365
13571366 if (maybe_error_match) |error_match| {
13581367 const result = try os.ChildProcess.exec(allocator, build_args.toSliceConst(), null, &env_map, max_doc_file_size);
13591368 switch (result.term) {