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

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

Issue 279023002: Add GN function get_label_info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comment Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/settings.h ('k') | no next file » | 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/settings.h" 5 #include "tools/gn/settings.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "tools/gn/filesystem_utils.h" 9 #include "tools/gn/filesystem_utils.h"
10 10
11 Settings::Settings(const BuildSettings* build_settings, 11 Settings::Settings(const BuildSettings* build_settings,
12 const std::string& output_subdir_name) 12 const std::string& output_subdir_name)
13 : build_settings_(build_settings), 13 : build_settings_(build_settings),
14 import_manager_(), 14 import_manager_(),
15 base_config_(this), 15 base_config_(this),
16 greedy_target_generation_(false) { 16 greedy_target_generation_(false) {
17 DCHECK(output_subdir_name.find('/') == std::string::npos);
18 if (output_subdir_name.empty()) { 17 if (output_subdir_name.empty()) {
19 toolchain_output_dir_ = build_settings->build_dir(); 18 toolchain_output_dir_ = build_settings->build_dir();
20 } else { 19 } else {
21 // We guarantee this ends in a slash. 20 // We guarantee this ends in a slash.
21 DCHECK(output_subdir_name[output_subdir_name.size() - 1] == '/');
22 toolchain_output_subdir_.value().append(output_subdir_name); 22 toolchain_output_subdir_.value().append(output_subdir_name);
23 toolchain_output_subdir_.value().push_back('/');
24 23
25 DCHECK(!build_settings->build_dir().is_null()); 24 DCHECK(!build_settings->build_dir().is_null());
26 toolchain_output_dir_ = SourceDir(build_settings->build_dir().value() + 25 toolchain_output_dir_ = SourceDir(build_settings->build_dir().value() +
27 toolchain_output_subdir_.value()); 26 toolchain_output_subdir_.value());
28 } 27 }
29 // The output dir will be null in some tests and when invoked to parsed 28 // The output dir will be null in some tests and when invoked to parsed
30 // one-off data without doing generation. 29 // one-off data without doing generation.
31 if (!toolchain_output_dir_.is_null()) 30 if (!toolchain_output_dir_.is_null())
32 toolchain_gen_dir_ = SourceDir(toolchain_output_dir_.value() + "gen/"); 31 toolchain_gen_dir_ = SourceDir(toolchain_output_dir_.value() + "gen/");
33 32
34 #if defined(OS_WIN) 33 #if defined(OS_WIN)
35 target_os_ = WIN; 34 target_os_ = WIN;
36 #elif defined(OS_MACOSX) 35 #elif defined(OS_MACOSX)
37 target_os_ = MAC; 36 target_os_ = MAC;
38 #elif defined(OS_LINUX) 37 #elif defined(OS_LINUX)
39 target_os_ = LINUX; 38 target_os_ = LINUX;
40 #else 39 #else
41 #error implement me 40 #error implement me
42 #endif 41 #endif
43 } 42 }
44 43
45 Settings::~Settings() { 44 Settings::~Settings() {
46 } 45 }
OLDNEW
« no previous file with comments | « tools/gn/settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698