stage2: Make zig cc more verbose (#7166)

* stage2: Make zig cc more verbose

Make `zig cc` print more info from Clang itself and from our own linker
invocation, this is needed for CMake to properly discover all the
include directories and library search paths.

Closes #7110

* Update `update_clang_options`

* Typo fixes

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
This commit is contained in:
LemonBoy
2020-11-19 23:30:16 +01:00
committed by GitHub
parent 647c6e0d09
commit 8eaaa905f7
7 changed files with 47 additions and 14 deletions
+12 -3
View File
@@ -1062,9 +1062,17 @@ fn buildOutputType(
}
},
.linker_script => linker_script = it.only_arg,
.verbose_cmds => {
verbose_cc = true;
.verbose => {
verbose_link = true;
// Have Clang print more infos, some tools such as CMake
// parse this to discover any implicit include and
// library dir to look-up into.
try clang_argv.append("-v");
},
.dry_run => {
verbose_link = true;
try clang_argv.append("-###");
// XXX: Don't execute anything!
},
.for_linker => try linker_args.append(it.only_arg),
.linker_input_z => {
@@ -2776,7 +2784,8 @@ pub const ClangArgIterator = struct {
debug,
sanitize,
linker_script,
verbose_cmds,
dry_run,
verbose,
for_linker,
linker_input_z,
lib_dir,