diff options
| author | Shritesh Bhattarai <shritesh@shritesh.com> | 2019-05-02 09:48:33 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-05-03 15:56:33 -0400 |
| commit | 2f39da7cddca3e3ae6a3c92f2a52eab77f311ccc (patch) | |
| tree | 1ceacb77682b393cac05e8677b2d68a798e24ce3 | |
| parent | 5c04c22bcc04fba8f84fa8e5ec57482c13d0a488 (diff) | |
| download | zig-2f39da7cddca3e3ae6a3c92f2a52eab77f311ccc.tar.gz zig-2f39da7cddca3e3ae6a3c92f2a52eab77f311ccc.zip | |
docgen: show -target command line argument
| -rw-r--r-- | doc/docgen.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/docgen.zig b/doc/docgen.zig index b7c3f1e21c..75c80cc528 100644 --- a/doc/docgen.zig +++ b/doc/docgen.zig @@ -1068,6 +1068,9 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var } if (code.target_str) |triple| { try build_args.appendSlice([][]const u8{ "-target", triple }); + if (!code.is_inline) { + try out.print(" -target {}", triple); + } } if (expected_outcome == .BuildFail) { const result = try os.ChildProcess.exec( @@ -1110,7 +1113,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var (builtin.os != builtin.Os.linux or builtin.arch != builtin.Arch.x86_64)) { // skip execution - try out.print("\n$ # Skipping execution because it is non-native.</code></pre>\n"); + try out.print("</code></pre>\n"); break :code_block; } } @@ -1174,6 +1177,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var } if (code.target_str) |triple| { try test_args.appendSlice([][]const u8{ "-target", triple }); + try out.print(" -target {}", triple); } const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed"); const escaped_stderr = try escapeHtml(allocator, result.stderr); @@ -1354,6 +1358,11 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var }, } + if (code.target_str) |triple| { + try build_args.appendSlice([][]const u8{ "-target", triple }); + try out.print(" -target {}", triple); + } + if (maybe_error_match) |error_match| { const result = try os.ChildProcess.exec(allocator, build_args.toSliceConst(), null, &env_map, max_doc_file_size); switch (result.term) { |
