| 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 be22cca2ffb182e314561b384ddc833451c7eed7..58cb96411a4267c6f181c45c42706d529168bffa 100644
|
| --- a/tools/gn/function_get_label_info.cc
|
| +++ b/tools/gn/function_get_label_info.cc
|
| @@ -11,14 +11,6 @@
|
|
|
| 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.";
|
| @@ -117,29 +109,25 @@ Value RunGetLabelInfo(Scope* scope,
|
| result.string_value() = DirectoryWithNoLastSlash(label.dir());
|
|
|
| } else if (what == "target_gen_dir") {
|
| - result.string_value() = DirectoryWithNoLastSlash(
|
| - GetGenDirForSourceDir(scope->settings(), label.dir()));
|
| + result.string_value() = DirectoryWithNoLastSlash(GetSubBuildDirAsSourceDir(
|
| + BuildDirContext(scope, label.GetToolchainLabel()),
|
| + label.dir(),
|
| + BuildDirType::GEN));
|
|
|
| } else if (what == "root_gen_dir") {
|
| - Label toolchain_label = label.GetToolchainLabel();
|
| - result.string_value() = DirectoryWithNoLastSlash(
|
| - GetToolchainGenDir(scope->settings()->build_settings(),
|
| - toolchain_label,
|
| - ToolchainIsDefault(scope, toolchain_label)));
|
| + result.string_value() = DirectoryWithNoLastSlash(GetBuildDirAsSourceDir(
|
| + BuildDirContext(scope, label.GetToolchainLabel()), BuildDirType::GEN));
|
|
|
| } else if (what == "target_out_dir") {
|
| - Label toolchain_label = label.GetToolchainLabel();
|
| - result.string_value() = DirectoryWithNoLastSlash(
|
| - GetOutputDirForSourceDir(scope->settings()->build_settings(),
|
| - label.dir(), toolchain_label,
|
| - ToolchainIsDefault(scope, toolchain_label)));
|
| + result.string_value() = DirectoryWithNoLastSlash(GetSubBuildDirAsSourceDir(
|
| + BuildDirContext(scope, label.GetToolchainLabel()),
|
| + label.dir(),
|
| + BuildDirType::OBJ));
|
|
|
| } else if (what == "root_out_dir") {
|
| - Label toolchain_label = label.GetToolchainLabel();
|
| - result.string_value() = DirectoryWithNoLastSlash(
|
| - GetToolchainOutputDir(scope->settings()->build_settings(),
|
| - toolchain_label,
|
| - ToolchainIsDefault(scope, toolchain_label)));
|
| + result.string_value() = DirectoryWithNoLastSlash(GetBuildDirAsSourceDir(
|
| + BuildDirContext(scope, label.GetToolchainLabel()),
|
| + BuildDirType::TOOLCHAIN_ROOT));
|
|
|
| } else if (what == "toolchain") {
|
| result.string_value() = label.GetToolchainLabel().GetUserVisibleName(false);
|
|
|