| 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) { | 487 if (is_win) { |
| 488 # Many targets remove these configs, so they are not contained within |
| 489 # //build/config:executable_config for easy removal. |
| 489 _windows_linker_configs = [ | 490 _windows_linker_configs = [ |
| 490 "//build/config/win:default_incremental_linking", | 491 "//build/config/win:default_incremental_linking", |
| 491 "//build/config/win:sdk_link", | |
| 492 "//build/config/win:common_linker_setup", | |
| 493 | 492 |
| 494 # Default to console-mode apps. Most of our targets are tests and such | 493 # Default to console-mode apps. Most of our targets are tests and such |
| 495 # that shouldn't use the windows subsystem. | 494 # that shouldn't use the windows subsystem. |
| 496 "//build/config/win:console", | 495 "//build/config/win:console", |
| 497 ] | 496 ] |
| 498 } | 497 } |
| 499 | 498 |
| 500 # Executable defaults. | 499 # Executable defaults. |
| 501 _executable_configs = | 500 _executable_configs = _native_compiler_configs + [ |
| 502 _native_compiler_configs + [ "//build/config:default_libs" ] | 501 "//build/config:default_libs", |
| 502 "//build/config:executable_config", |
| 503 ] |
| 503 if (is_win) { | 504 if (is_win) { |
| 504 _executable_configs += _windows_linker_configs | 505 _executable_configs += _windows_linker_configs |
| 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 } | 506 } |
| 516 set_defaults("executable") { | 507 set_defaults("executable") { |
| 517 configs = _executable_configs | 508 configs = _executable_configs |
| 518 } | 509 } |
| 519 | 510 |
| 520 # Static library defaults. | 511 # Static library defaults. |
| 521 set_defaults("static_library") { | 512 set_defaults("static_library") { |
| 522 configs = _native_compiler_configs | 513 configs = _native_compiler_configs |
| 523 } | 514 } |
| 524 | 515 |
| 525 # Shared library and loadable module defaults (also for components in component | 516 # Shared library and loadable module defaults (also for components in component |
| 526 # mode). | 517 # mode). |
| 527 _shared_library_configs = | 518 _shared_library_configs = _native_compiler_configs + [ |
| 528 _native_compiler_configs + [ "//build/config:default_libs" ] | 519 "//build/config:default_libs", |
| 520 "//build/config:shared_library_config", |
| 521 ] |
| 529 if (is_win) { | 522 if (is_win) { |
| 530 _shared_library_configs += _windows_linker_configs | 523 _shared_library_configs += _windows_linker_configs |
| 531 } else if (is_mac) { | |
| 532 _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ] | |
| 533 } else if (is_android) { | 524 } else if (is_android) { |
| 534 # Strip native JNI exports from shared libraries by default. Binaries that | 525 # Strip native JNI exports from shared libraries by default. Binaries that |
| 535 # want this can remove this config. | 526 # want this can remove this config. |
| 536 _shared_library_configs += | 527 _shared_library_configs += |
| 537 [ "//build/config/android:hide_native_jni_exports" ] | 528 [ "//build/config/android:hide_native_jni_exports" ] |
| 538 } | 529 } |
| 539 set_defaults("shared_library") { | 530 set_defaults("shared_library") { |
| 540 configs = _shared_library_configs | 531 configs = _shared_library_configs |
| 541 } | 532 } |
| 542 set_defaults("loadable_module") { | 533 set_defaults("loadable_module") { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 forward_variables_from(invoker, "*") | 572 forward_variables_from(invoker, "*") |
| 582 | 573 |
| 583 # All shared libraries must have the sanitizer deps to properly link in | 574 # All shared libraries must have the sanitizer deps to properly link in |
| 584 # asan mode (this target will be empty in other cases). | 575 # asan mode (this target will be empty in other cases). |
| 585 if (!defined(deps)) { | 576 if (!defined(deps)) { |
| 586 deps = [] | 577 deps = [] |
| 587 } | 578 } |
| 588 deps += [ "//build/config/sanitizers:deps" ] | 579 deps += [ "//build/config/sanitizers:deps" ] |
| 589 } | 580 } |
| 590 } | 581 } |
| OLD | NEW |