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

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

Issue 51693002: GN: toolchain threading cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/input_conversion.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/gyp_helper.h" 5 #include "tools/gn/gyp_helper.h"
6 6
7 #include "tools/gn/err.h" 7 #include "tools/gn/err.h"
8 #include "tools/gn/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
9 #include "tools/gn/settings.h" 9 #include "tools/gn/settings.h"
10 #include "tools/gn/source_file.h" 10 #include "tools/gn/source_file.h"
(...skipping 27 matching lines...) Expand all
38 *err = Err(Location(), "Need to specify a gyp_file value for " + 38 *err = Err(Location(), "Need to specify a gyp_file value for " +
39 target->label().GetUserVisibleName(false) + "\n" 39 target->label().GetUserVisibleName(false) + "\n"
40 "since I can't make up one with no name."); 40 "since I can't make up one with no name.");
41 return SourceFile(); 41 return SourceFile();
42 } 42 }
43 43
44 return SourceFile(dir + dir_name + ".gyp"); 44 return SourceFile(dir + dir_name + ".gyp");
45 } 45 }
46 46
47 std::string GypHelper::GetNameForTarget(const Target* target) const { 47 std::string GypHelper::GetNameForTarget(const Target* target) const {
48 const Toolchain* toolchain = target->settings()->toolchain(); 48 if (target->settings()->is_default())
49 if (toolchain->is_default())
50 return target->label().name(); // Default toolchain has no suffix. 49 return target->label().name(); // Default toolchain has no suffix.
51 return target->label().name() + "_" + toolchain->label().name(); 50 return target->label().name() + "_" +
51 target->settings()->toolchain_label().name();
52 } 52 }
53 53
54 std::string GypHelper::GetFullRefForTarget(const Target* target) const { 54 std::string GypHelper::GetFullRefForTarget(const Target* target) const {
55 Err err; 55 Err err;
56 SourceFile gypfile = GetGypFileForTarget(target, &err); 56 SourceFile gypfile = GetGypFileForTarget(target, &err);
57 CHECK(gypfile.is_source_absolute()) << 57 CHECK(gypfile.is_source_absolute()) <<
58 "GYP files should not be system-absolute: " << gypfile.value(); 58 "GYP files should not be system-absolute: " << gypfile.value();
59 59
60 std::string ret("<(DEPTH)/"); 60 std::string ret("<(DEPTH)/");
61 // Trim off the leading double-slash. 61 // Trim off the leading double-slash.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 ret.append(&dir.value()[2], dir.value().size() - 2); 96 ret.append(&dir.value()[2], dir.value().size() - 2);
97 } 97 }
98 98
99 // Optionally trim the slash off the end. 99 // Optionally trim the slash off the end.
100 if (!ret.empty() && !include_slash && 100 if (!ret.empty() && !include_slash &&
101 (ret[ret.size() - 1] == '/' || ret[ret.size() - 1] == '\\')) 101 (ret[ret.size() - 1] == '/' || ret[ret.size() - 1] == '\\'))
102 ret.resize(ret.size() - 1); 102 ret.resize(ret.size() - 1);
103 103
104 return ret; 104 return ret;
105 } 105 }
OLDNEW
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/input_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698