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...@@ -1068,6 +1068,9 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1068 }1068 }
1069 if (code.target_str) |triple| {1069 if (code.target_str) |triple| {
1070 try build_args.appendSlice([][]const u8{ "-target", triple });1070 try build_args.appendSlice([][]const u8{ "-target", triple });
1071 if (!code.is_inline) {
1072 try out.print(" -target {}", triple);
1073 }
1071 }1074 }
1072 if (expected_outcome == .BuildFail) {1075 if (expected_outcome == .BuildFail) {
1073 const result = try os.ChildProcess.exec(1076 const result = try os.ChildProcess.exec(
...@@ -1110,7 +1113,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1110,7 +1113,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1110 (builtin.os != builtin.Os.linux or builtin.arch != builtin.Arch.x86_64))1113 (builtin.os != builtin.Os.linux or builtin.arch != builtin.Arch.x86_64))
1111 {1114 {
1112 // skip execution1115 // skip execution
1113 try out.print("\n$ # Skipping execution because it is non-native.</code></pre>\n");1116 try out.print("</code></pre>\n");
1114 break :code_block;1117 break :code_block;
1115 }1118 }
1116 }1119 }
...@@ -1174,6 +1177,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1174,6 +1177,7 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1174 }1177 }
1175 if (code.target_str) |triple| {1178 if (code.target_str) |triple| {
1176 try test_args.appendSlice([][]const u8{ "-target", triple });1179 try test_args.appendSlice([][]const u8{ "-target", triple });
1180 try out.print(" -target {}", triple);
1177 }1181 }
1178 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");1182 const result = exec(allocator, &env_map, test_args.toSliceConst()) catch return parseError(tokenizer, code.source_token, "test failed");
1179 const escaped_stderr = try escapeHtml(allocator, result.stderr);1183 const escaped_stderr = try escapeHtml(allocator, result.stderr);
...@@ -1354,6 +1358,11 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var...@@ -1354,6 +1358,11 @@ fn genHtml(allocator: *mem.Allocator, tokenizer: *Tokenizer, toc: *Toc, out: var
1354 },1358 },
1355 }1359 }
13561360
1361 if (code.target_str) |triple| {
1362 try build_args.appendSlice([][]const u8{ "-target", triple });
1363 try out.print(" -target {}", triple);
1364 }
1365
1357 if (maybe_error_match) |error_match| {1366 if (maybe_error_match) |error_match| {
1358 const result = try os.ChildProcess.exec(allocator, build_args.toSliceConst(), null, &env_map, max_doc_file_size);1367 const result = try os.ChildProcess.exec(allocator, build_args.toSliceConst(), null, &env_map, max_doc_file_size);
1359 switch (result.term) {1368 switch (result.term) {