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

Side by Side Diff: build/config/BUILDCONFIG.gn

Issue 766573003: gn format //build (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 | « build/config/BUILD.gn ('k') | build/config/allocator.gni » ('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 # ============================================================================= 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 # -1 means auto-set (off in release, regular in debug). 25 # -1 means auto-set (off in release, regular in debug).
26 symbol_level = -1 26 symbol_level = -1
27 27
28 # Component build. 28 # Component build.
29 is_component_build = false 29 is_component_build = false
30
30 # Debug build. 31 # Debug build.
31 is_debug = true 32 is_debug = true
32 33
33 # Set to true when compiling with the Clang compiler. Typically this is used 34 # Set to true when compiling with the Clang compiler. Typically this is used
34 # to configure warnings. 35 # to configure warnings.
35 is_clang = (os == "mac" || os == "ios" || os == "linux" || os == "chromeos") 36 is_clang = os == "mac" || os == "ios" || os == "linux" || os == "chromeos"
36 37
37 # Selects the desired build flavor. Official builds get additional 38 # Selects the desired build flavor. Official builds get additional
38 # processing to prepare for release. Normally you will want to develop and 39 # processing to prepare for release. Normally you will want to develop and
39 # test with this flag off. 40 # test with this flag off.
40 is_official_build = false 41 is_official_build = false
41 42
42 # Select the desired branding flavor. False means normal Chromium branding, 43 # Select the desired branding flavor. False means normal Chromium branding,
43 # true means official Google Chrome branding (requires extra Google-internal 44 # true means official Google Chrome branding (requires extra Google-internal
44 # resources). 45 # resources).
45 is_chrome_branded = false 46 is_chrome_branded = false
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 "*_ios.h", 232 "*_ios.h",
232 "*_ios.cc", 233 "*_ios.cc",
233 "*_ios.mm", 234 "*_ios.mm",
234 "*_ios_unittest.h", 235 "*_ios_unittest.h",
235 "*_ios_unittest.cc", 236 "*_ios_unittest.cc",
236 "*_ios_unittest.mm", 237 "*_ios_unittest.mm",
237 "*\bios/*", 238 "*\bios/*",
238 ] 239 ]
239 } 240 }
240 if (!is_mac && !is_ios) { 241 if (!is_mac && !is_ios) {
241 sources_assignment_filter += [ 242 sources_assignment_filter += [ "*.mm" ]
242 "*.mm",
243 ]
244 } 243 }
245 if (!is_linux) { 244 if (!is_linux) {
246 sources_assignment_filter += [ 245 sources_assignment_filter += [
247 "*_linux.h", 246 "*_linux.h",
248 "*_linux.cc", 247 "*_linux.cc",
249 "*_linux_unittest.h", 248 "*_linux_unittest.h",
250 "*_linux_unittest.cc", 249 "*_linux_unittest.cc",
251 "*\blinux/*", 250 "*\blinux/*",
252 ] 251 ]
253 } 252 }
254 if (!is_android) { 253 if (!is_android) {
255 sources_assignment_filter += [ 254 sources_assignment_filter += [
256 "*_android.h", 255 "*_android.h",
257 "*_android.cc", 256 "*_android.cc",
258 "*_android_unittest.h", 257 "*_android_unittest.h",
259 "*_android_unittest.cc", 258 "*_android_unittest.cc",
260 "*\bandroid/*", 259 "*\bandroid/*",
261 ] 260 ]
262 } 261 }
263 if (!is_chromeos) { 262 if (!is_chromeos) {
264 sources_assignment_filter += [ 263 sources_assignment_filter += [
265 "*_chromeos.h", 264 "*_chromeos.h",
266 "*_chromeos.cc", 265 "*_chromeos.cc",
267 "*_chromeos_unittest.h", 266 "*_chromeos_unittest.h",
268 "*_chromeos_unittest.cc", 267 "*_chromeos_unittest.cc",
269 "*\bchromeos/*", 268 "*\bchromeos/*",
270 ] 269 ]
271 } 270 }
271
272 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call 272 # DO NOT ADD MORE PATTERNS TO THIS LIST, see set_sources_assignment_filter call
273 # below. 273 # below.
274 274
275 # Actually save this list. 275 # Actually save this list.
276 # 276 #
277 # These patterns are executed for every file in the source tree of every run. 277 # These patterns are executed for every file in the source tree of every run.
278 # Therefore, adding more patterns slows down the build for everybody. We should 278 # Therefore, adding more patterns slows down the build for everybody. We should
279 # only add automatic patterns for configurations affecting hundreds of files 279 # only add automatic patterns for configurations affecting hundreds of files
280 # across many projects in the tree. 280 # across many projects in the tree.
281 # 281 #
(...skipping 20 matching lines...) Expand all
302 # 302 #
303 # Set up the default configuration for every build target of the given type. 303 # Set up the default configuration for every build target of the given type.
304 # The values configured here will be automatically set on the scope of the 304 # The values configured here will be automatically set on the scope of the
305 # corresponding target. Target definitions can add or remove to the settings 305 # corresponding target. Target definitions can add or remove to the settings
306 # here as needed. 306 # here as needed.
307 307
308 # Holds all configs used for making native executables and libraries, to avoid 308 # Holds all configs used for making native executables and libraries, to avoid
309 # duplication in each target below. 309 # duplication in each target below.
310 _native_compiler_configs = [ 310 _native_compiler_configs = [
311 "//build/config:feature_flags", 311 "//build/config:feature_flags",
312
313 "//build/config/compiler:compiler", 312 "//build/config/compiler:compiler",
314 "//build/config/compiler:compiler_arm_fpu", 313 "//build/config/compiler:compiler_arm_fpu",
315 "//build/config/compiler:chromium_code", 314 "//build/config/compiler:chromium_code",
316 "//build/config/compiler:default_include_dirs", 315 "//build/config/compiler:default_include_dirs",
317 "//build/config/compiler:default_warnings", 316 "//build/config/compiler:default_warnings",
318 "//build/config/compiler:no_rtti", 317 "//build/config/compiler:no_rtti",
319 "//build/config/compiler:runtime_library", 318 "//build/config/compiler:runtime_library",
320 ] 319 ]
321 if (is_win) { 320 if (is_win) {
322 _native_compiler_configs += [ 321 _native_compiler_configs += [
323 "//build/config/win:lean_and_mean", 322 "//build/config/win:lean_and_mean",
324 "//build/config/win:nominmax", 323 "//build/config/win:nominmax",
325 "//build/config/win:sdk", 324 "//build/config/win:sdk",
326 "//build/config/win:unicode", 325 "//build/config/win:unicode",
327 "//build/config/win:winver", 326 "//build/config/win:winver",
328 ] 327 ]
329 } 328 }
330 if (is_posix) { 329 if (is_posix) {
331 _native_compiler_configs += [ 330 _native_compiler_configs += [
332 "//build/config/gcc:no_exceptions", 331 "//build/config/gcc:no_exceptions",
333 "//build/config/gcc:symbol_visibility_hidden", 332 "//build/config/gcc:symbol_visibility_hidden",
334 ] 333 ]
335 } 334 }
336 335
337 if (is_linux) { 336 if (is_linux) {
338 _native_compiler_configs += [ "//build/config/linux:sdk", ] 337 _native_compiler_configs += [ "//build/config/linux:sdk" ]
339 } else if (is_mac) { 338 } else if (is_mac) {
340 _native_compiler_configs += [ "//build/config/mac:sdk", ] 339 _native_compiler_configs += [ "//build/config/mac:sdk" ]
341 } else if (is_ios) { 340 } else if (is_ios) {
342 _native_compiler_configs += [ "//build/config/ios:sdk", ] 341 _native_compiler_configs += [ "//build/config/ios:sdk" ]
343 } else if (is_android) { 342 } else if (is_android) {
344 _native_compiler_configs += [ "//build/config/android:sdk", ] 343 _native_compiler_configs += [ "//build/config/android:sdk" ]
345 } 344 }
346 345
347 if (is_clang) { 346 if (is_clang) {
348 _native_compiler_configs += [ 347 _native_compiler_configs += [
349 "//build/config/clang:find_bad_constructs", 348 "//build/config/clang:find_bad_constructs",
350 "//build/config/clang:extra_warnings", 349 "//build/config/clang:extra_warnings",
351 ] 350 ]
352 } 351 }
353 352
354 # Optimizations and debug checking. 353 # Optimizations and debug checking.
(...skipping 26 matching lines...) Expand all
381 _default_symbols_config = "//build/config/compiler:no_symbols" 380 _default_symbols_config = "//build/config/compiler:no_symbols"
382 } else { 381 } else {
383 assert(false, "Bad value for symbol_level.") 382 assert(false, "Bad value for symbol_level.")
384 } 383 }
385 _native_compiler_configs += [ _default_symbols_config ] 384 _native_compiler_configs += [ _default_symbols_config ]
386 385
387 # Windows linker setup for EXEs and DLLs. 386 # Windows linker setup for EXEs and DLLs.
388 if (is_win) { 387 if (is_win) {
389 if (is_debug) { 388 if (is_debug) {
390 _default_incremental_linking_config = 389 _default_incremental_linking_config =
391 "//build/config/win:incremental_linking" 390 "//build/config/win:incremental_linking"
392 } else { 391 } else {
393 _default_incremental_linking_config = 392 _default_incremental_linking_config =
394 "//build/config/win:no_incremental_linking" 393 "//build/config/win:no_incremental_linking"
395 } 394 }
396 _windows_linker_configs = [ 395 _windows_linker_configs = [
397 _default_incremental_linking_config, 396 _default_incremental_linking_config,
398 "//build/config/win:sdk_link", 397 "//build/config/win:sdk_link",
399 "//build/config/win:common_linker_setup", 398 "//build/config/win:common_linker_setup",
399
400 # Default to console-mode apps. Most of our targets are tests and such 400 # Default to console-mode apps. Most of our targets are tests and such
401 # that shouldn't use the windows subsystem. 401 # that shouldn't use the windows subsystem.
402 "//build/config/win:console", 402 "//build/config/win:console",
403 ] 403 ]
404 } 404 }
405 405
406 # Executable defaults. 406 # Executable defaults.
407 _executable_configs = _native_compiler_configs + [ 407 _executable_configs =
408 "//build/config:default_libs", 408 _native_compiler_configs + [ "//build/config:default_libs" ]
409 ]
410 if (is_win) { 409 if (is_win) {
411 _executable_configs += _windows_linker_configs 410 _executable_configs += _windows_linker_configs
412 } else if (is_mac) { 411 } else if (is_mac) {
413 _executable_configs += [ 412 _executable_configs += [
414 "//build/config/mac:mac_dynamic_flags", 413 "//build/config/mac:mac_dynamic_flags",
415 "//build/config/mac:mac_executable_flags" ] 414 "//build/config/mac:mac_executable_flags",
415 ]
416 } else if (is_linux || is_android) { 416 } else if (is_linux || is_android) {
417 _executable_configs += [ "//build/config/gcc:executable_ldconfig" ] 417 _executable_configs += [ "//build/config/gcc:executable_ldconfig" ]
418 if (is_android) { 418 if (is_android) {
419 _executable_configs += [ "//build/config/android:executable_config" ] 419 _executable_configs += [ "//build/config/android:executable_config" ]
420 } 420 }
421 } 421 }
422 set_defaults("executable") { 422 set_defaults("executable") {
423 configs = _executable_configs 423 configs = _executable_configs
424 } 424 }
425 425
426 # Static library defaults. 426 # Static library defaults.
427 set_defaults("static_library") { 427 set_defaults("static_library") {
428 configs = _native_compiler_configs 428 configs = _native_compiler_configs
429 } 429 }
430 430
431 # Shared library defaults (also for components in component mode). 431 # Shared library defaults (also for components in component mode).
432 _shared_library_configs = _native_compiler_configs + [ 432 _shared_library_configs =
433 "//build/config:default_libs", 433 _native_compiler_configs + [ "//build/config:default_libs" ]
434 ]
435 if (is_win) { 434 if (is_win) {
436 _shared_library_configs += _windows_linker_configs 435 _shared_library_configs += _windows_linker_configs
437 } else if (is_mac) { 436 } else if (is_mac) {
438 _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ] 437 _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ]
439 } 438 }
440 set_defaults("shared_library") { 439 set_defaults("shared_library") {
441 configs = _shared_library_configs 440 configs = _shared_library_configs
442 } 441 }
443 if (is_component_build) { 442 if (is_component_build) {
444 set_defaults("component") { 443 set_defaults("component") {
(...skipping 13 matching lines...) Expand all
458 457
459 # Test defaults. 458 # Test defaults.
460 set_defaults("test") { 459 set_defaults("test") {
461 if (is_android) { 460 if (is_android) {
462 configs = _shared_library_configs 461 configs = _shared_library_configs
463 } else { 462 } else {
464 configs = _executable_configs 463 configs = _executable_configs
465 } 464 }
466 } 465 }
467 466
468
469 # ============================================================================== 467 # ==============================================================================
470 # TOOLCHAIN SETUP 468 # TOOLCHAIN SETUP
471 # ============================================================================== 469 # ==============================================================================
472 # 470 #
473 # Here we set the default toolchain, as well as the variable host_toolchain 471 # Here we set the default toolchain, as well as the variable host_toolchain
474 # which will identify the toolchain corresponding to the local system when 472 # which will identify the toolchain corresponding to the local system when
475 # doing cross-compiles. When not cross-compiling, this will be the same as the 473 # doing cross-compiles. When not cross-compiling, this will be the same as the
476 # default toolchain. 474 # default toolchain.
477 475
478 if (is_win) { 476 if (is_win) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 # above. We want to use those rather than whatever came with the nested 527 # above. We want to use those rather than whatever came with the nested
530 # shared/static library inside the component. 528 # shared/static library inside the component.
531 configs = [] # Prevent list overwriting warning. 529 configs = [] # Prevent list overwriting warning.
532 configs = invoker.configs 530 configs = invoker.configs
533 531
534 # The sources assignment filter will have already been applied when the 532 # The sources assignment filter will have already been applied when the
535 # code was originally executed. We don't want to apply it again, since 533 # code was originally executed. We don't want to apply it again, since
536 # the original target may have override it for some assignments. 534 # the original target may have override it for some assignments.
537 set_sources_assignment_filter([]) 535 set_sources_assignment_filter([])
538 536
539 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invo ker.all_dependent_configs } 537 if (defined(invoker.all_dependent_configs)) {
540 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includ es_from = invoker.allow_circular_includes_from } 538 all_dependent_configs = invoker.all_dependent_configs
541 if (defined(invoker.cflags)) { cflags = invoker.cflags } 539 }
542 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 540 if (defined(invoker.allow_circular_includes_from)) {
543 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 541 allow_circular_includes_from = invoker.allow_circular_includes_from
544 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 542 }
545 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 543 if (defined(invoker.cflags)) {
546 if (defined(invoker.check_includes)) { check_includes = invoker.check_incl udes } 544 cflags = invoker.cflags
547 if (defined(invoker.data)) { data = invoker.data } 545 }
548 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 546 if (defined(invoker.cflags_c)) {
549 if (defined(invoker.defines)) { defines = invoker.defines } 547 cflags_c = invoker.cflags_c
548 }
549 if (defined(invoker.cflags_cc)) {
550 cflags_cc = invoker.cflags_cc
551 }
552 if (defined(invoker.cflags_objc)) {
553 cflags_objc = invoker.cflags_objc
554 }
555 if (defined(invoker.cflags_objcc)) {
556 cflags_objcc = invoker.cflags_objcc
557 }
558 if (defined(invoker.check_includes)) {
559 check_includes = invoker.check_includes
560 }
561 if (defined(invoker.data)) {
562 data = invoker.data
563 }
564 if (defined(invoker.datadeps)) {
565 datadeps = invoker.datadeps
566 }
567 if (defined(invoker.defines)) {
568 defines = invoker.defines
569 }
570
550 # All shared libraries must have the sanitizer deps to properly link in 571 # All shared libraries must have the sanitizer deps to properly link in
551 # asan mode (this target will be empty in other cases). 572 # asan mode (this target will be empty in other cases).
552 if (defined(invoker.deps)) { 573 if (defined(invoker.deps)) {
553 deps = invoker.deps + [ "//build/config/sanitizers:deps" ] 574 deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
554 } else { 575 } else {
555 deps = [ "//build/config/sanitizers:deps" ] 576 deps = [
577 "//build/config/sanitizers:deps",
578 ]
556 } 579 }
557 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 580 if (defined(invoker.direct_dependent_configs)) {
558 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_c onfigs_from = invoker.forward_dependent_configs_from } 581 direct_dependent_configs = invoker.direct_dependent_configs
559 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 582 }
560 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 583 if (defined(invoker.forward_dependent_configs_from)) {
561 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 584 forward_dependent_configs_from = invoker.forward_dependent_configs_from
562 if (defined(invoker.libs)) { libs = invoker.libs } 585 }
563 if (defined(invoker.output_extension)) { output_extension = invoker.output _extension } 586 if (defined(invoker.include_dirs)) {
564 if (defined(invoker.output_name)) { output_name = invoker.output_name } 587 include_dirs = invoker.include_dirs
565 if (defined(invoker.public)) { public = invoker.public } 588 }
566 if (defined(invoker.public_configs)) { public_configs = invoker.public_con figs } 589 if (defined(invoker.ldflags)) {
567 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 590 ldflags = invoker.ldflags
568 if (defined(invoker.sources)) { sources = invoker.sources } 591 }
569 if (defined(invoker.testonly)) { testonly = invoker.testonly } 592 if (defined(invoker.lib_dirs)) {
570 if (defined(invoker.visibility)) { visibility = invoker.visibility } 593 lib_dirs = invoker.lib_dirs
594 }
595 if (defined(invoker.libs)) {
596 libs = invoker.libs
597 }
598 if (defined(invoker.output_extension)) {
599 output_extension = invoker.output_extension
600 }
601 if (defined(invoker.output_name)) {
602 output_name = invoker.output_name
603 }
604 if (defined(invoker.public)) {
605 public = invoker.public
606 }
607 if (defined(invoker.public_configs)) {
608 public_configs = invoker.public_configs
609 }
610 if (defined(invoker.public_deps)) {
611 public_deps = invoker.public_deps
612 }
613 if (defined(invoker.sources)) {
614 sources = invoker.sources
615 }
616 if (defined(invoker.testonly)) {
617 testonly = invoker.testonly
618 }
619 if (defined(invoker.visibility)) {
620 visibility = invoker.visibility
621 }
571 } 622 }
572 } else { 623 } else {
573 source_set(target_name) { 624 source_set(target_name) {
574 # See above. 625 # See above.
575 configs = [] # Prevent list overwriting warning. 626 configs = [] # Prevent list overwriting warning.
576 configs = invoker.configs 627 configs = invoker.configs
577 628
578 # See above call. 629 # See above call.
579 set_sources_assignment_filter([]) 630 set_sources_assignment_filter([])
580 631
581 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invo ker.all_dependent_configs } 632 if (defined(invoker.all_dependent_configs)) {
582 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includ es_from = invoker.allow_circular_includes_from } 633 all_dependent_configs = invoker.all_dependent_configs
583 if (defined(invoker.cflags)) { cflags = invoker.cflags } 634 }
584 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 635 if (defined(invoker.allow_circular_includes_from)) {
585 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 636 allow_circular_includes_from = invoker.allow_circular_includes_from
586 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 637 }
587 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 638 if (defined(invoker.cflags)) {
588 if (defined(invoker.check_includes)) { check_includes = invoker.check_incl udes } 639 cflags = invoker.cflags
589 if (defined(invoker.data)) { data = invoker.data } 640 }
590 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 641 if (defined(invoker.cflags_c)) {
591 if (defined(invoker.defines)) { defines = invoker.defines } 642 cflags_c = invoker.cflags_c
592 if (defined(invoker.deps)) { deps = invoker.deps } 643 }
593 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 644 if (defined(invoker.cflags_cc)) {
594 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_c onfigs_from = invoker.forward_dependent_configs_from } 645 cflags_cc = invoker.cflags_cc
595 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 646 }
596 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 647 if (defined(invoker.cflags_objc)) {
597 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 648 cflags_objc = invoker.cflags_objc
598 if (defined(invoker.libs)) { libs = invoker.libs } 649 }
599 if (defined(invoker.output_extension)) { output_extension = invoker.output _extension } 650 if (defined(invoker.cflags_objcc)) {
600 if (defined(invoker.output_name)) { output_name = invoker.output_name } 651 cflags_objcc = invoker.cflags_objcc
601 if (defined(invoker.public)) { public = invoker.public } 652 }
602 if (defined(invoker.public_configs)) { public_configs = invoker.public_con figs } 653 if (defined(invoker.check_includes)) {
603 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 654 check_includes = invoker.check_includes
604 if (defined(invoker.sources)) { sources = invoker.sources } 655 }
605 if (defined(invoker.testonly)) { testonly = invoker.testonly } 656 if (defined(invoker.data)) {
606 if (defined(invoker.visibility)) { visibility = invoker.visibility } 657 data = invoker.data
658 }
659 if (defined(invoker.datadeps)) {
660 datadeps = invoker.datadeps
661 }
662 if (defined(invoker.defines)) {
663 defines = invoker.defines
664 }
665 if (defined(invoker.deps)) {
666 deps = invoker.deps
667 }
668 if (defined(invoker.direct_dependent_configs)) {
669 direct_dependent_configs = invoker.direct_dependent_configs
670 }
671 if (defined(invoker.forward_dependent_configs_from)) {
672 forward_dependent_configs_from = invoker.forward_dependent_configs_from
673 }
674 if (defined(invoker.include_dirs)) {
675 include_dirs = invoker.include_dirs
676 }
677 if (defined(invoker.ldflags)) {
678 ldflags = invoker.ldflags
679 }
680 if (defined(invoker.lib_dirs)) {
681 lib_dirs = invoker.lib_dirs
682 }
683 if (defined(invoker.libs)) {
684 libs = invoker.libs
685 }
686 if (defined(invoker.output_extension)) {
687 output_extension = invoker.output_extension
688 }
689 if (defined(invoker.output_name)) {
690 output_name = invoker.output_name
691 }
692 if (defined(invoker.public)) {
693 public = invoker.public
694 }
695 if (defined(invoker.public_configs)) {
696 public_configs = invoker.public_configs
697 }
698 if (defined(invoker.public_deps)) {
699 public_deps = invoker.public_deps
700 }
701 if (defined(invoker.sources)) {
702 sources = invoker.sources
703 }
704 if (defined(invoker.testonly)) {
705 testonly = invoker.testonly
706 }
707 if (defined(invoker.visibility)) {
708 visibility = invoker.visibility
709 }
607 } 710 }
608 } 711 }
609 } 712 }
610 713
611 # ============================================================================== 714 # ==============================================================================
612 # TEST SETUP 715 # TEST SETUP
613 # ============================================================================== 716 # ==============================================================================
614 717
615 # Define a test as an executable (or shared_library on Android) with the 718 # Define a test as an executable (or shared_library on Android) with the
616 # "testonly" flag set. 719 # "testonly" flag set.
617 template("test") { 720 template("test") {
618 if (is_android) { 721 if (is_android) {
619 shared_library(target_name) { 722 shared_library(target_name) {
620 # Configs will always be defined since we set_defaults for a component 723 # Configs will always be defined since we set_defaults for a component
621 # above. We want to use those rather than whatever came with the nested 724 # above. We want to use those rather than whatever came with the nested
622 # shared/static library inside the component. 725 # shared/static library inside the component.
623 configs = [] # Prevent list overwriting warning. 726 configs = [] # Prevent list overwriting warning.
624 configs = invoker.configs 727 configs = invoker.configs
625 728
626 # See above call. 729 # See above call.
627 set_sources_assignment_filter([]) 730 set_sources_assignment_filter([])
628 731
629 testonly = true 732 testonly = true
630 733
631 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invo ker.all_dependent_configs } 734 if (defined(invoker.all_dependent_configs)) {
632 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includ es_from = invoker.allow_circular_includes_from } 735 all_dependent_configs = invoker.all_dependent_configs
633 if (defined(invoker.cflags)) { cflags = invoker.cflags } 736 }
634 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 737 if (defined(invoker.allow_circular_includes_from)) {
635 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 738 allow_circular_includes_from = invoker.allow_circular_includes_from
636 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 739 }
637 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 740 if (defined(invoker.cflags)) {
638 if (defined(invoker.check_includes)) { check_includes = invoker.check_incl udes } 741 cflags = invoker.cflags
639 if (defined(invoker.data)) { data = invoker.data } 742 }
640 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 743 if (defined(invoker.cflags_c)) {
641 if (defined(invoker.defines)) { defines = invoker.defines } 744 cflags_c = invoker.cflags_c
642 if (defined(invoker.deps)) { deps = invoker.deps } 745 }
643 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 746 if (defined(invoker.cflags_cc)) {
644 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_c onfigs_from = invoker.forward_dependent_configs_from } 747 cflags_cc = invoker.cflags_cc
645 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 748 }
646 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 749 if (defined(invoker.cflags_objc)) {
647 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 750 cflags_objc = invoker.cflags_objc
648 if (defined(invoker.libs)) { libs = invoker.libs } 751 }
649 if (defined(invoker.output_extension)) { output_extension = invoker.output _extension } 752 if (defined(invoker.cflags_objcc)) {
650 if (defined(invoker.output_name)) { output_name = invoker.output_name } 753 cflags_objcc = invoker.cflags_objcc
651 if (defined(invoker.public)) { public = invoker.public } 754 }
652 if (defined(invoker.public_configs)) { public_configs = invoker.public_con figs } 755 if (defined(invoker.check_includes)) {
653 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 756 check_includes = invoker.check_includes
654 if (defined(invoker.sources)) { sources = invoker.sources } 757 }
655 if (defined(invoker.visibility)) { visibility = invoker.visibility } 758 if (defined(invoker.data)) {
759 data = invoker.data
760 }
761 if (defined(invoker.datadeps)) {
762 datadeps = invoker.datadeps
763 }
764 if (defined(invoker.defines)) {
765 defines = invoker.defines
766 }
767 if (defined(invoker.deps)) {
768 deps = invoker.deps
769 }
770 if (defined(invoker.direct_dependent_configs)) {
771 direct_dependent_configs = invoker.direct_dependent_configs
772 }
773 if (defined(invoker.forward_dependent_configs_from)) {
774 forward_dependent_configs_from = invoker.forward_dependent_configs_from
775 }
776 if (defined(invoker.include_dirs)) {
777 include_dirs = invoker.include_dirs
778 }
779 if (defined(invoker.ldflags)) {
780 ldflags = invoker.ldflags
781 }
782 if (defined(invoker.lib_dirs)) {
783 lib_dirs = invoker.lib_dirs
784 }
785 if (defined(invoker.libs)) {
786 libs = invoker.libs
787 }
788 if (defined(invoker.output_extension)) {
789 output_extension = invoker.output_extension
790 }
791 if (defined(invoker.output_name)) {
792 output_name = invoker.output_name
793 }
794 if (defined(invoker.public)) {
795 public = invoker.public
796 }
797 if (defined(invoker.public_configs)) {
798 public_configs = invoker.public_configs
799 }
800 if (defined(invoker.public_deps)) {
801 public_deps = invoker.public_deps
802 }
803 if (defined(invoker.sources)) {
804 sources = invoker.sources
805 }
806 if (defined(invoker.visibility)) {
807 visibility = invoker.visibility
808 }
656 } 809 }
657 } else { 810 } else {
658 executable(target_name) { 811 executable(target_name) {
659 # See above. 812 # See above.
660 configs = [] # Prevent list overwriting warning. 813 configs = [] # Prevent list overwriting warning.
661 configs = invoker.configs 814 configs = invoker.configs
662 815
663 # See above call. 816 # See above call.
664 set_sources_assignment_filter([]) 817 set_sources_assignment_filter([])
665 818
666 testonly = true 819 testonly = true
667 820
668 if (defined(invoker.all_dependent_configs)) { all_dependent_configs = invo ker.all_dependent_configs } 821 if (defined(invoker.all_dependent_configs)) {
669 if (defined(invoker.allow_circular_includes_from)) { allow_circular_includ es_from = invoker.allow_circular_includes_from } 822 all_dependent_configs = invoker.all_dependent_configs
670 if (defined(invoker.cflags)) { cflags = invoker.cflags } 823 }
671 if (defined(invoker.cflags_c)) { cflags_c = invoker.cflags_c } 824 if (defined(invoker.allow_circular_includes_from)) {
672 if (defined(invoker.cflags_cc)) { cflags_cc = invoker.cflags_cc } 825 allow_circular_includes_from = invoker.allow_circular_includes_from
673 if (defined(invoker.cflags_objc)) { cflags_objc = invoker.cflags_objc } 826 }
674 if (defined(invoker.cflags_objcc)) { cflags_objcc = invoker.cflags_objcc } 827 if (defined(invoker.cflags)) {
675 if (defined(invoker.check_includes)) { check_includes = invoker.check_incl udes } 828 cflags = invoker.cflags
676 if (defined(invoker.data)) { data = invoker.data } 829 }
677 if (defined(invoker.datadeps)) { datadeps = invoker.datadeps } 830 if (defined(invoker.cflags_c)) {
678 if (defined(invoker.defines)) { defines = invoker.defines } 831 cflags_c = invoker.cflags_c
832 }
833 if (defined(invoker.cflags_cc)) {
834 cflags_cc = invoker.cflags_cc
835 }
836 if (defined(invoker.cflags_objc)) {
837 cflags_objc = invoker.cflags_objc
838 }
839 if (defined(invoker.cflags_objcc)) {
840 cflags_objcc = invoker.cflags_objcc
841 }
842 if (defined(invoker.check_includes)) {
843 check_includes = invoker.check_includes
844 }
845 if (defined(invoker.data)) {
846 data = invoker.data
847 }
848 if (defined(invoker.datadeps)) {
849 datadeps = invoker.datadeps
850 }
851 if (defined(invoker.defines)) {
852 defines = invoker.defines
853 }
854
679 # All shared libraries must have the sanitizer deps to properly link in 855 # All shared libraries must have the sanitizer deps to properly link in
680 # asan mode (this target will be empty in other cases). 856 # asan mode (this target will be empty in other cases).
681 if (defined(invoker.deps)) { 857 if (defined(invoker.deps)) {
682 deps = invoker.deps + [ "//build/config/sanitizers:deps" ] 858 deps = invoker.deps + [ "//build/config/sanitizers:deps" ]
683 } else { 859 } else {
684 deps = [ "//build/config/sanitizers:deps" ] 860 deps = [
861 "//build/config/sanitizers:deps",
862 ]
685 } 863 }
686 if (defined(invoker.direct_dependent_configs)) { direct_dependent_configs = invoker.direct_dependent_configs } 864 if (defined(invoker.direct_dependent_configs)) {
687 if (defined(invoker.forward_dependent_configs_from)) { forward_dependent_c onfigs_from = invoker.forward_dependent_configs_from } 865 direct_dependent_configs = invoker.direct_dependent_configs
688 if (defined(invoker.include_dirs)) { include_dirs = invoker.include_dirs } 866 }
689 if (defined(invoker.ldflags)) { ldflags = invoker.ldflags } 867 if (defined(invoker.forward_dependent_configs_from)) {
690 if (defined(invoker.lib_dirs)) { lib_dirs = invoker.lib_dirs } 868 forward_dependent_configs_from = invoker.forward_dependent_configs_from
691 if (defined(invoker.libs)) { libs = invoker.libs } 869 }
692 if (defined(invoker.output_extension)) { output_extension = invoker.output _extension } 870 if (defined(invoker.include_dirs)) {
693 if (defined(invoker.output_name)) { output_name = invoker.output_name } 871 include_dirs = invoker.include_dirs
694 if (defined(invoker.public)) { public = invoker.public } 872 }
695 if (defined(invoker.public_configs)) { public_configs = invoker.public_con figs } 873 if (defined(invoker.ldflags)) {
696 if (defined(invoker.public_deps)) { public_deps = invoker.public_deps } 874 ldflags = invoker.ldflags
697 if (defined(invoker.sources)) { sources = invoker.sources } 875 }
698 if (defined(invoker.visibility)) { visibility = invoker.visibility } 876 if (defined(invoker.lib_dirs)) {
877 lib_dirs = invoker.lib_dirs
878 }
879 if (defined(invoker.libs)) {
880 libs = invoker.libs
881 }
882 if (defined(invoker.output_extension)) {
883 output_extension = invoker.output_extension
884 }
885 if (defined(invoker.output_name)) {
886 output_name = invoker.output_name
887 }
888 if (defined(invoker.public)) {
889 public = invoker.public
890 }
891 if (defined(invoker.public_configs)) {
892 public_configs = invoker.public_configs
893 }
894 if (defined(invoker.public_deps)) {
895 public_deps = invoker.public_deps
896 }
897 if (defined(invoker.sources)) {
898 sources = invoker.sources
899 }
900 if (defined(invoker.visibility)) {
901 visibility = invoker.visibility
902 }
699 } 903 }
700 } 904 }
701 } 905 }
OLDNEW
« no previous file with comments | « build/config/BUILD.gn ('k') | build/config/allocator.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698