| Index: tools/gn/function_get_label_info.cc
|
| diff --git a/tools/gn/function_get_label_info.cc b/tools/gn/function_get_label_info.cc
|
| index c097941e278ca3c9849d8d826629ce6f8d1a4605..dd5e5867a65bad82a1f1e5997fdddb9d0c2c18eb 100644
|
| --- a/tools/gn/function_get_label_info.cc
|
| +++ b/tools/gn/function_get_label_info.cc
|
| @@ -11,6 +11,14 @@
|
|
|
| namespace functions {
|
|
|
| +namespace {
|
| +
|
| +bool ToolchainIsDefault(const Scope* scope, const Label& toolchain_label) {
|
| + return scope->settings()->default_toolchain_label() == toolchain_label;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| const char kGetLabelInfo[] = "get_label_info";
|
| const char kGetLabelInfo_HelpShort[] =
|
| "get_label_info: Get an attribute from a target's label.";
|
| @@ -114,23 +122,24 @@ Value RunGetLabelInfo(Scope* scope,
|
|
|
| } else if (what == "root_gen_dir") {
|
| Label toolchain_label = label.GetToolchainLabel();
|
| - bool is_default =
|
| - scope->settings()->default_toolchain_label() == toolchain_label;
|
| result.string_value() = DirectoryWithNoLastSlash(
|
| GetToolchainGenDir(scope->settings()->build_settings(),
|
| - toolchain_label, is_default));
|
| + toolchain_label,
|
| + ToolchainIsDefault(scope, toolchain_label)));
|
|
|
| } else if (what == "target_out_dir") {
|
| + Label toolchain_label = label.GetToolchainLabel();
|
| result.string_value() = DirectoryWithNoLastSlash(
|
| - GetOutputDirForSourceDir(scope->settings(), label.dir()));
|
| + GetOutputDirForSourceDir(scope->settings()->build_settings(),
|
| + label.dir(), toolchain_label,
|
| + ToolchainIsDefault(scope, toolchain_label)));
|
|
|
| } else if (what == "root_out_dir") {
|
| Label toolchain_label = label.GetToolchainLabel();
|
| - bool is_default =
|
| - scope->settings()->default_toolchain_label() == toolchain_label;
|
| result.string_value() = DirectoryWithNoLastSlash(
|
| GetToolchainOutputDir(scope->settings()->build_settings(),
|
| - toolchain_label, is_default));
|
| + toolchain_label,
|
| + ToolchainIsDefault(scope, toolchain_label)));
|
|
|
| } else if (what == "toolchain") {
|
| result.string_value() = label.GetToolchainLabel().GetUserVisibleName(false);
|
|
|