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

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

Issue 2581193003: GN: Add optional default_args variable to .gn. (Closed)
Patch Set: Address comment. Created 3 years, 11 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 | « no previous file | tools/gn/setup.h » ('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/args.h" 5 #include "tools/gn/args.h"
6 6
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "tools/gn/string_utils.h" 9 #include "tools/gn/string_utils.h"
10 #include "tools/gn/variables.h" 10 #include "tools/gn/variables.h"
11 11
12 const char kBuildArgs_Help[] = 12 const char kBuildArgs_Help[] =
13 R"(Build Arguments Overview 13 R"(Build Arguments Overview
14 14
15 Build arguments are variables passed in from outside of the build that build 15 Build arguments are variables passed in from outside of the build that build
16 files can query to determine how the build works. 16 files can query to determine how the build works.
17 17
18 How build arguments are set 18 How build arguments are set
19 19
20 First, system default arguments are set based on the current system. The 20 First, system default arguments are set based on the current system. The
21 built-in arguments are: 21 built-in arguments are:
22 - host_cpu 22 - host_cpu
23 - host_os 23 - host_os
24 - current_cpu 24 - current_cpu
25 - current_os 25 - current_os
26 - target_cpu 26 - target_cpu
27 - target_os 27 - target_os
28 28
29 Next, project-specific overrides are applied. These are specified inside
30 the default_args variable of //.gn. See "gn help dotfile" for more.
31
29 If specified, arguments from the --args command line flag are used. If that 32 If specified, arguments from the --args command line flag are used. If that
30 flag is not specified, args from previous builds in the build directory will 33 flag is not specified, args from previous builds in the build directory will
31 be used (this is in the file args.gn in the build directory). 34 be used (this is in the file args.gn in the build directory).
32 35
33 Last, for targets being compiled with a non-default toolchain, the toolchain 36 Last, for targets being compiled with a non-default toolchain, the toolchain
34 overrides are applied. These are specified in the toolchain_args section of a 37 overrides are applied. These are specified in the toolchain_args section of a
35 toolchain definition. The use-case for this is that a toolchain may be 38 toolchain definition. The use-case for this is that a toolchain may be
36 building code for a different platform, and that it may want to always 39 building code for a different platform, and that it may want to always
37 specify Posix, for example. See "gn help toolchain" for more. 40 specify Posix, for example. See "gn help toolchain" for more.
38 41
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 Scope* scope) const { 374 Scope* scope) const {
372 lock_.AssertAcquired(); 375 lock_.AssertAcquired();
373 return declared_arguments_per_toolchain_[scope->settings()]; 376 return declared_arguments_per_toolchain_[scope->settings()];
374 } 377 }
375 378
376 Scope::KeyValueMap& Args::OverridesForToolchainLocked( 379 Scope::KeyValueMap& Args::OverridesForToolchainLocked(
377 Scope* scope) const { 380 Scope* scope) const {
378 lock_.AssertAcquired(); 381 lock_.AssertAcquired();
379 return toolchain_overrides_[scope->settings()]; 382 return toolchain_overrides_[scope->settings()];
380 } 383 }
OLDNEW
« no previous file with comments | « no previous file | tools/gn/setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698