Return the 'output basename' of a gyp spec, split into filename + ext. Android libraries must be named the same thing as their module name, otherwise the linker can't find them, so product_name and so on must be ignored if we are building a library, and the "lib" prepending
(self, spec)
| 667 | return "".join([prefix, middle, suffix]) |
| 668 | |
| 669 | def ComputeOutputParts(self, spec): |
| 670 | """Return the 'output basename' of a gyp spec, split into filename + ext. |
| 671 | |
| 672 | Android libraries must be named the same thing as their module name, |
| 673 | otherwise the linker can't find them, so product_name and so on must be |
| 674 | ignored if we are building a library, and the "lib" prepending is |
| 675 | not done for Android. |
| 676 | """ |
| 677 | assert self.type != "loadable_module" # TODO: not supported? |
| 678 | |
| 679 | target = spec["target_name"] |
| 680 | target_prefix = "" |
| 681 | target_ext = "" |
| 682 | if self.type == "static_library": |
| 683 | target = self.ComputeAndroidModule(spec) |
| 684 | target_ext = ".a" |
| 685 | elif self.type == "shared_library": |
| 686 | target = self.ComputeAndroidModule(spec) |
| 687 | target_ext = ".so" |
| 688 | elif self.type == "none": |
| 689 | target_ext = ".stamp" |
| 690 | elif self.type != "executable": |
| 691 | print( |
| 692 | "ERROR: What output file should be generated?", |
| 693 | "type", |
| 694 | self.type, |
| 695 | "target", |
| 696 | target, |
| 697 | ) |
| 698 | |
| 699 | if self.type not in {"static_library", "shared_library"}: |
| 700 | target_prefix = spec.get("product_prefix", target_prefix) |
| 701 | target = spec.get("product_name", target) |
| 702 | product_ext = spec.get("product_extension") |
| 703 | if product_ext: |
| 704 | target_ext = "." + product_ext |
| 705 | |
| 706 | target_stem = target_prefix + target |
| 707 | return (target_stem, target_ext) |
| 708 | |
| 709 | def ComputeOutputBasename(self, spec): |
| 710 | """Return the 'output basename' of a gyp spec. |
no test coverage detected