 Chromium Code Reviews
 Chromium Code Reviews Issue 1548473003:
  GN Don't enable linker version script for components  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1548473003:
  GN Don't enable linker version script for components  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 } | 542 } | 
| 543 set_defaults("shared_library") { | 543 set_defaults("shared_library") { | 
| 544 configs = _shared_library_configs | 544 configs = _shared_library_configs | 
| 545 } | 545 } | 
| 546 set_defaults("loadable_module") { | 546 set_defaults("loadable_module") { | 
| 547 configs = _shared_library_configs | 547 configs = _shared_library_configs | 
| 548 } | 548 } | 
| 549 if (is_component_build) { | 549 if (is_component_build) { | 
| 550 set_defaults("component") { | 550 set_defaults("component") { | 
| 551 configs = _shared_library_configs | 551 configs = _shared_library_configs | 
| 552 if (is_android) { | |
| 553 configs -= [ "//build/config/android:hide_native_jni_exports" ] | |
| 554 } | |
| 552 } | 555 } | 
| 553 } | 556 } | 
| 554 | 557 | 
| 555 # Source set defaults (also for components in non-component mode). | 558 # Source set defaults (also for components in non-component mode). | 
| 556 set_defaults("source_set") { | 559 set_defaults("source_set") { | 
| 557 configs = _native_compiler_configs | 560 configs = _native_compiler_configs | 
| 558 } | 561 } | 
| 559 if (!is_component_build) { | 562 if (!is_component_build) { | 
| 560 set_defaults("component") { | 563 set_defaults("component") { | 
| 561 configs = _native_compiler_configs | 564 configs = _native_compiler_configs | 
| 562 } | 565 } | 
| 563 } | 566 } | 
| 564 | 567 | 
| 565 # Test defaults. | 568 # Test defaults. | 
| 566 set_defaults("test") { | 569 set_defaults("test") { | 
| 567 if (is_android) { | 570 if (is_android) { | 
| 568 configs = _shared_library_configs | 571 configs = _shared_library_configs | 
| 569 } else { | 572 } else { | 
| 570 configs = _executable_configs | 573 configs = _executable_configs | 
| 571 } | 574 } | 
| 572 } | 575 } | 
| 573 | 576 | 
| 574 # ============================================================================== | 577 # ============================================================================== | 
| 575 # COMPONENT SETUP | 578 # COMPONENT SETUP | 
| 576 # ============================================================================== | 579 # ============================================================================== | 
| 577 | 580 | 
| 578 if (is_component_build) { | |
| 579 _component_mode = "shared_library" | |
| 580 } else { | |
| 581 _component_mode = "source_set" | |
| 582 } | |
| 583 template("component") { | 581 template("component") { | 
| 582 # Some targets (e.g. //base) should user static_library rather than source_set | |
| 
brettw
2016/01/04 22:24:53
...rather than source set in non-component builds.
 
agrieve
2016/01/05 02:46:47
Done.
 | |
| 583 # in order to not link unused object files. | |
| 584 _never_use_source_set = | |
| 585 defined(invoker.never_use_source_set) && invoker.never_use_source_set | |
| 
brettw
2016/01/04 22:24:53
I'd feel better if this parameter was called "invo
 
agrieve
2016/01/05 02:46:47
Done.
 | |
| 586 assert(_never_use_source_set || true) # Mark as used. | |
| 587 if (is_component_build) { | |
| 588 _component_mode = "shared_library" | |
| 589 } else if (_never_use_source_set) { | |
| 
brettw
2016/01/04 22:24:53
Why not just write:
  } else if (defined(invoker.c
 
agrieve
2016/01/05 02:46:47
I tried this at first, but it complains of an unus
 | |
| 590 _component_mode = "static_library" | |
| 591 } else { | |
| 592 _component_mode = "source_set" | |
| 593 } | |
| 584 target(_component_mode, target_name) { | 594 target(_component_mode, target_name) { | 
| 585 forward_variables_from(invoker, "*") | 595 forward_variables_from(invoker, "*") | 
| 586 | 596 | 
| 587 # All shared libraries must have the sanitizer deps to properly link in | 597 # All shared libraries must have the sanitizer deps to properly link in | 
| 588 # asan mode (this target will be empty in other cases). | 598 # asan mode (this target will be empty in other cases). | 
| 589 if (!defined(deps)) { | 599 if (!defined(deps)) { | 
| 590 deps = [] | 600 deps = [] | 
| 591 } | 601 } | 
| 592 deps += [ "//build/config/sanitizers:deps" ] | 602 deps += [ "//build/config/sanitizers:deps" ] | 
| 593 } | 603 } | 
| 594 } | 604 } | 
| OLD | NEW |