Return the Android module name used for a gyp spec. We use the complete qualified target name to avoid collisions between duplicate targets in different directories. We also add a suffix to distinguish gyp-generated module names.
(self, spec)
| 636 | self.WriteSourceFlags(spec, configs) |
| 637 | |
| 638 | def ComputeAndroidModule(self, spec): |
| 639 | """Return the Android module name used for a gyp spec. |
| 640 | |
| 641 | We use the complete qualified target name to avoid collisions between |
| 642 | duplicate targets in different directories. We also add a suffix to |
| 643 | distinguish gyp-generated module names. |
| 644 | """ |
| 645 | |
| 646 | if int(spec.get("android_unmangled_name", 0)): |
| 647 | assert self.type != "shared_library" or self.target.startswith("lib") |
| 648 | return self.target |
| 649 | |
| 650 | if self.type == "shared_library": |
| 651 | # For reasons of convention, the Android build system requires that all |
| 652 | # shared library modules are named 'libfoo' when generating -l flags. |
| 653 | prefix = "lib_" |
| 654 | else: |
| 655 | prefix = "" |
| 656 | |
| 657 | if spec["toolset"] == "host": |
| 658 | suffix = "_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp" |
| 659 | else: |
| 660 | suffix = "_gyp" |
| 661 | |
| 662 | if self.path: |
| 663 | middle = make.StringToMakefileVariable(f"{self.path}_{self.target}") |
| 664 | else: |
| 665 | middle = make.StringToMakefileVariable(self.target) |
| 666 | |
| 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. |
no test coverage detected