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 # PLATFORM SELECTION | 6 # PLATFORM SELECTION |
7 # ============================================================================= | 7 # ============================================================================= |
8 # | 8 # |
9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name | 9 # There are two main things to set: "os" and "cpu". The "toolchain" is the name |
10 # of the GN thing that encodes combinations of these things. | 10 # of the GN thing that encodes combinations of these things. |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 ] | 477 ] |
478 } | 478 } |
479 | 479 |
480 # Debug/release-related defines. | 480 # Debug/release-related defines. |
481 if (is_debug) { | 481 if (is_debug) { |
482 _native_compiler_configs += [ "//build/config:debug" ] | 482 _native_compiler_configs += [ "//build/config:debug" ] |
483 } else { | 483 } else { |
484 _native_compiler_configs += [ "//build/config:release" ] | 484 _native_compiler_configs += [ "//build/config:release" ] |
485 } | 485 } |
486 | 486 |
487 # Windows linker setup for EXEs and DLLs. | |
488 if (is_win) { | |
489 _windows_linker_configs = [ | |
490 "//build/config/win:default_incremental_linking", | |
491 "//build/config/win:sdk_link", | |
492 "//build/config/win:common_linker_setup", | |
493 | |
494 # Default to console-mode apps. Most of our targets are tests and such | |
495 # that shouldn't use the windows subsystem. | |
496 "//build/config/win:console", | |
497 ] | |
498 } | |
499 | |
500 # Executable defaults. | 487 # Executable defaults. |
501 _executable_configs = | 488 _executable_configs = _native_compiler_configs + [ |
502 _native_compiler_configs + [ "//build/config:default_libs" ] | 489 "//build/config:default_libs", |
503 if (is_win) { | 490 "//build/config:executable_config", |
504 _executable_configs += _windows_linker_configs | 491 ] |
505 } else if (is_mac) { | |
506 _executable_configs += [ | |
507 "//build/config/mac:mac_dynamic_flags", | |
508 "//build/config/mac:mac_executable_flags", | |
509 ] | |
510 } else if (is_linux || is_android) { | |
511 _executable_configs += [ "//build/config/gcc:executable_ldconfig" ] | |
512 if (is_android) { | |
513 _executable_configs += [ "//build/config/android:executable_config" ] | |
514 } | |
515 } | |
516 set_defaults("executable") { | 492 set_defaults("executable") { |
517 configs = _executable_configs | 493 configs = _executable_configs |
518 } | 494 } |
519 | 495 |
520 # Static library defaults. | 496 # Static library defaults. |
521 set_defaults("static_library") { | 497 set_defaults("static_library") { |
522 configs = _native_compiler_configs | 498 configs = _native_compiler_configs |
523 } | 499 } |
524 | 500 |
525 # Shared library and loadable module defaults (also for components in component | 501 # Shared library and loadable module defaults (also for components in component |
526 # mode). | 502 # mode). |
527 _shared_library_configs = | 503 _shared_library_configs = _native_compiler_configs + [ |
528 _native_compiler_configs + [ "//build/config:default_libs" ] | 504 "//build/config:default_libs", |
529 if (is_win) { | 505 "//build/config:shared_library_config", |
530 _shared_library_configs += _windows_linker_configs | 506 ] |
531 } else if (is_mac) { | 507 |
532 _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ] | |
533 } else if (is_android) { | |
534 # Strip native JNI exports from shared libraries by default. Binaries that | |
535 # want this can remove this config. | |
536 _shared_library_configs += | |
537 [ "//build/config/android:hide_native_jni_exports" ] | |
538 } | |
539 set_defaults("shared_library") { | 508 set_defaults("shared_library") { |
540 configs = _shared_library_configs | 509 configs = _shared_library_configs |
541 } | 510 } |
542 set_defaults("loadable_module") { | 511 set_defaults("loadable_module") { |
543 configs = _shared_library_configs | 512 configs = _shared_library_configs |
544 } | 513 } |
545 if (is_component_build) { | 514 if (is_component_build) { |
546 set_defaults("component") { | 515 set_defaults("component") { |
547 configs = _shared_library_configs | 516 configs = _shared_library_configs |
548 } | 517 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 forward_variables_from(invoker, "*") | 550 forward_variables_from(invoker, "*") |
582 | 551 |
583 # All shared libraries must have the sanitizer deps to properly link in | 552 # All shared libraries must have the sanitizer deps to properly link in |
584 # asan mode (this target will be empty in other cases). | 553 # asan mode (this target will be empty in other cases). |
585 if (!defined(deps)) { | 554 if (!defined(deps)) { |
586 deps = [] | 555 deps = [] |
587 } | 556 } |
588 deps += [ "//build/config/sanitizers:deps" ] | 557 deps += [ "//build/config/sanitizers:deps" ] |
589 } | 558 } |
590 } | 559 } |
OLD | NEW |