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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 # The invoker can override the type of the target in the non-component-build | 632 # The invoker can override the type of the target in the non-component-build |
633 # case by setting static_component_type to either "source_set" or | 633 # case by setting static_component_type to either "source_set" or |
634 # "static_library". If unset, the default will be used. | 634 # "static_library". If unset, the default will be used. |
635 template("component") { | 635 template("component") { |
636 if (is_component_build) { | 636 if (is_component_build) { |
637 _component_mode = "shared_library" | 637 _component_mode = "shared_library" |
638 } else if (defined(invoker.static_component_type)) { | 638 } else if (defined(invoker.static_component_type)) { |
639 assert(invoker.static_component_type == "static_library" || | 639 assert(invoker.static_component_type == "static_library" || |
640 invoker.static_component_type == "source_set") | 640 invoker.static_component_type == "source_set") |
641 _component_mode = invoker.static_component_type | 641 _component_mode = invoker.static_component_type |
642 } else if (!defined(invoker.sources) || is_mac) { | 642 } else if (!defined(invoker.sources)) { |
643 # When there are no sources defined, use a source set to avoid creating | 643 # When there are no sources defined, use a source set to avoid creating |
644 # an empty static library (which generally don't work). | 644 # an empty static library (which generally don't work). |
645 # | |
646 # TODO(brettw) bug 618797: Remove the mac condition. On Mac making these as | |
647 # static_library causes crashes. Remove the mac condition above when this | |
648 # is fixed. | |
649 _component_mode = "source_set" | 645 _component_mode = "source_set" |
650 } else { | 646 } else { |
651 _component_mode = "static_library" | 647 _component_mode = "static_library" |
652 } | 648 } |
653 target(_component_mode, target_name) { | 649 target(_component_mode, target_name) { |
654 # Explicitly forward visibility, implicitly forward everything else. | 650 # Explicitly forward visibility, implicitly forward everything else. |
655 # Forwarding "*" doesn't recurse into nested scopes (to avoid copying all | 651 # Forwarding "*" doesn't recurse into nested scopes (to avoid copying all |
656 # globals into each template invocation), so won't pick up file-scoped | 652 # globals into each template invocation), so won't pick up file-scoped |
657 # variables. Normally this isn't too bad, but visibility is commonly | 653 # variables. Normally this isn't too bad, but visibility is commonly |
658 # defined at the file scope. Explicitly forwarding visibility and then | 654 # defined at the file scope. Explicitly forwarding visibility and then |
659 # excluding it from the "*" set works around this problem. | 655 # excluding it from the "*" set works around this problem. |
660 # See http://crbug.com/594610 | 656 # See http://crbug.com/594610 |
661 forward_variables_from(invoker, [ "visibility" ]) | 657 forward_variables_from(invoker, [ "visibility" ]) |
662 forward_variables_from(invoker, "*", [ "visibility" ]) | 658 forward_variables_from(invoker, "*", [ "visibility" ]) |
663 | 659 |
664 # All shared libraries must have the sanitizer deps to properly link in | 660 # All shared libraries must have the sanitizer deps to properly link in |
665 # asan mode (this target will be empty in other cases). | 661 # asan mode (this target will be empty in other cases). |
666 if (!defined(deps)) { | 662 if (!defined(deps)) { |
667 deps = [] | 663 deps = [] |
668 } | 664 } |
669 deps += [ "//build/config/sanitizers:deps" ] | 665 deps += [ "//build/config/sanitizers:deps" ] |
670 } | 666 } |
671 } | 667 } |
OLD | NEW |