xref: /aosp_15_r20/external/toolchain-utils/compiler_wrapper/print_config_flag.go (revision 760c253c1ed00ce9abd48f8546f08516e57485fe)
1// Copyright 2019 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package main
6
7import "fmt"
8
9func processPrintConfigFlag(builder *commandBuilder) {
10	printConfig := false
11	builder.transformArgs(func(arg builderArg) string {
12		if arg.value == "-print-config" {
13			printConfig = true
14			return ""
15		}
16		return arg.value
17	})
18	if printConfig {
19		fmt.Fprintf(builder.env.stderr(), "wrapper config: %#v\n", *builder.cfg)
20	}
21}
22