OLD | NEW |
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 # ============================================================================= | 5 # ============================================================================= |
6 # BUILD FLAGS | 6 # BUILD FLAGS |
7 # ============================================================================= | 7 # ============================================================================= |
8 # | 8 # |
9 # This block lists input arguments to the build, along with their default | 9 # This block lists input arguments to the build, along with their default |
10 # values. GN requires listing them explicitly so it can validate input and have | 10 # values. GN requires listing them explicitly so it can validate input and have |
11 # a central place to manage the build flags. | 11 # a central place to manage the build flags. |
12 # | 12 # |
13 # If a value is specified on the command line, it will overwrite the defaults | 13 # If a value is specified on the command line, it will overwrite the defaults |
14 # given here, otherwise the default will be injected into the root scope. | 14 # given here, otherwise the default will be injected into the root scope. |
15 # | 15 # |
16 # KEEP IN ALPHABETICAL ORDER and write a good description for everything. | 16 # KEEP IN ALPHABETICAL ORDER and write a good description for everything. |
17 # Use "is_*" names for intrinsic platform descriptions and build modes, and | 17 # Use "is_*" names for intrinsic platform descriptions and build modes, and |
18 # "use_*" names for optional features libraries, and configurations. | 18 # "use_*" names for optional features libraries, and configurations. |
19 declare_args() { | 19 declare_args() { |
20 # How many symbols to include in the build. This affects the performance of | 20 # How many symbols to include in the build. This affects the performance of |
21 # the build since the symbols are large and dealing with them is slow. | 21 # the build since the symbols are large and dealing with them is slow. |
22 # 2 means regular build with symbols. | 22 # 2 means regular build with symbols. |
23 # 1 means minimal symbols, usually enough for backtraces only. | 23 # 1 means minimal symbols, usually enough for backtraces only. |
24 # 0 means no symbols. | 24 # 0 means no symbols. |
25 symbol_level = 2 | 25 # -1 means auto-set (off in release, regular in debug). |
| 26 symbol_level = -1 |
26 | 27 |
27 # Component build. | 28 # Component build. |
28 is_component_build = false | 29 is_component_build = false |
29 # Debug build. | 30 # Debug build. |
30 is_debug = true | 31 is_debug = true |
31 | 32 |
32 # Set to true when compiling with the Clang compiler. Typically this is used | 33 # Set to true when compiling with the Clang compiler. Typically this is used |
33 # to configure warnings. | 34 # to configure warnings. |
34 is_clang = (os == "mac" || os == "ios" || os == "linux") | 35 is_clang = (os == "mac" || os == "ios" || os == "linux") |
35 | 36 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 # Optimizations and debug checking. | 348 # Optimizations and debug checking. |
348 if (is_debug) { | 349 if (is_debug) { |
349 _native_compiler_configs += [ "//build/config:debug" ] | 350 _native_compiler_configs += [ "//build/config:debug" ] |
350 _default_optimization_config = "//build/config/compiler:no_optimize" | 351 _default_optimization_config = "//build/config/compiler:no_optimize" |
351 } else { | 352 } else { |
352 _native_compiler_configs += [ "//build/config:release" ] | 353 _native_compiler_configs += [ "//build/config:release" ] |
353 _default_optimization_config = "//build/config/compiler:optimize" | 354 _default_optimization_config = "//build/config/compiler:optimize" |
354 } | 355 } |
355 _native_compiler_configs += [ _default_optimization_config ] | 356 _native_compiler_configs += [ _default_optimization_config ] |
356 | 357 |
| 358 # If it wasn't manually set, set to an appropriate default. |
| 359 if (symbol_level == -1) { |
| 360 # Linux is slowed by having symbols as part of the target binary, whereas |
| 361 # Mac and Windows have them separate, so in Release Linux, default them off. |
| 362 if (is_debug || !is_linux) { |
| 363 symbol_level = 2 |
| 364 } else { |
| 365 symbol_level = 0 |
| 366 } |
| 367 } |
| 368 |
357 # Symbol setup. | 369 # Symbol setup. |
358 if (symbol_level == 2) { | 370 if (symbol_level == 2) { |
359 _default_symbols_config = "//build/config/compiler:symbols" | 371 _default_symbols_config = "//build/config/compiler:symbols" |
360 } else if (symbol_level == 1) { | 372 } else if (symbol_level == 1) { |
361 _default_symbols_config = "//build/config/compiler:minimal_symbols" | 373 _default_symbols_config = "//build/config/compiler:minimal_symbols" |
362 } else if (symbol_level == 0) { | 374 } else if (symbol_level == 0) { |
363 _default_symbols_config = "//build/config/compiler:no_symbols" | 375 _default_symbols_config = "//build/config/compiler:no_symbols" |
364 } else { | 376 } else { |
365 assert(false, "Bad value for symbol_level.") | 377 assert(false, "Bad value for symbol_level.") |
366 } | 378 } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } | 665 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } |
654 if (defined(invoker.libs)) { libs = invoker.libs } | 666 if (defined(invoker.libs)) { libs = invoker.libs } |
655 if (defined(invoker.output_extension)) { output_extension = invoker.output
_extension } | 667 if (defined(invoker.output_extension)) { output_extension = invoker.output
_extension } |
656 if (defined(invoker.output_name)) { output_name = invoker.output_name } | 668 if (defined(invoker.output_name)) { output_name = invoker.output_name } |
657 if (defined(invoker.public)) { public = invoker.public } | 669 if (defined(invoker.public)) { public = invoker.public } |
658 if (defined(invoker.sources)) { sources = invoker.sources } | 670 if (defined(invoker.sources)) { sources = invoker.sources } |
659 if (defined(invoker.visibility)) { visibility = invoker.visibility } | 671 if (defined(invoker.visibility)) { visibility = invoker.visibility } |
660 } | 672 } |
661 } | 673 } |
662 } | 674 } |
OLD | NEW |