Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: tools/gn/ninja_utils.cc

Issue 2198433004: Make get_label_info take into account the toolchain for target_gen_dir (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused static function Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | tools/gn/scope_per_file_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/ninja_utils.h" 5 #include "tools/gn/ninja_utils.h"
6 6
7 #include "tools/gn/filesystem_utils.h" 7 #include "tools/gn/filesystem_utils.h"
8 #include "tools/gn/settings.h" 8 #include "tools/gn/settings.h"
9 #include "tools/gn/target.h" 9 #include "tools/gn/target.h"
10 10
11 SourceFile GetNinjaFileForTarget(const Target* target) { 11 SourceFile GetNinjaFileForTarget(const Target* target) {
12 return SourceFile(GetTargetOutputDir(target).value() + 12 return SourceFile(
13 target->label().name() + ".ninja"); 13 GetBuildDirForTargetAsSourceDir(target, BuildDirType::OBJ).value() +
14 target->label().name() + ".ninja");
14 } 15 }
15 16
16 SourceFile GetNinjaFileForToolchain(const Settings* settings) { 17 SourceFile GetNinjaFileForToolchain(const Settings* settings) {
17 return SourceFile(GetToolchainOutputDir(settings).value() + 18 return SourceFile(GetBuildDirAsSourceDir(
18 "toolchain.ninja"); 19 BuildDirContext(settings), BuildDirType::TOOLCHAIN_ROOT).value() +
20 "toolchain.ninja");
19 } 21 }
20 22
21 std::string GetNinjaRulePrefixForToolchain(const Settings* settings) { 23 std::string GetNinjaRulePrefixForToolchain(const Settings* settings) {
22 // Don't prefix the default toolchain so it looks prettier, prefix everything 24 // Don't prefix the default toolchain so it looks prettier, prefix everything
23 // else. 25 // else.
24 if (settings->is_default()) 26 if (settings->is_default())
25 return std::string(); // Default toolchain has no prefix. 27 return std::string(); // Default toolchain has no prefix.
26 return settings->toolchain_label().name() + "_"; 28 return settings->toolchain_label().name() + "_";
27 } 29 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_target_writer.cc ('k') | tools/gn/scope_per_file_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698