(
self,
properties=None,
id=None,
parent=None,
force_outdir=None,
force_prefix=None,
force_extension=None,
)
| 2476 | } |
| 2477 | |
| 2478 | def __init__( |
| 2479 | self, |
| 2480 | properties=None, |
| 2481 | id=None, |
| 2482 | parent=None, |
| 2483 | force_outdir=None, |
| 2484 | force_prefix=None, |
| 2485 | force_extension=None, |
| 2486 | ): |
| 2487 | # super |
| 2488 | XCTarget.__init__(self, properties, id, parent) |
| 2489 | |
| 2490 | if ( |
| 2491 | "productName" in self._properties |
| 2492 | and "productType" in self._properties |
| 2493 | and "productReference" not in self._properties |
| 2494 | and self._properties["productType"] in self._product_filetypes |
| 2495 | ): |
| 2496 | products_group = None |
| 2497 | pbxproject = self.PBXProjectAncestor() |
| 2498 | if pbxproject is not None: |
| 2499 | products_group = pbxproject.ProductsGroup() |
| 2500 | |
| 2501 | if products_group is not None: |
| 2502 | (filetype, prefix, suffix) = self._product_filetypes[ |
| 2503 | self._properties["productType"] |
| 2504 | ] |
| 2505 | # Xcode does not have a distinct type for loadable modules that are |
| 2506 | # pure BSD targets (not in a bundle wrapper). GYP allows such modules |
| 2507 | # to be specified by setting a target type to loadable_module without |
| 2508 | # having mac_bundle set. These are mapped to the pseudo-product type |
| 2509 | # com.googlecode.gyp.xcode.bundle. |
| 2510 | # |
| 2511 | # By picking up this special type and converting it to a dynamic |
| 2512 | # library (com.apple.product-type.library.dynamic) with fix-ups, |
| 2513 | # single-file loadable modules can be produced. |
| 2514 | # |
| 2515 | # MACH_O_TYPE is changed to mh_bundle to produce the proper file type |
| 2516 | # (as opposed to mh_dylib). In order for linking to succeed, |
| 2517 | # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be |
| 2518 | # cleared. They are meaningless for type mh_bundle. |
| 2519 | # |
| 2520 | # Finally, the .so extension is forcibly applied over the default |
| 2521 | # (.dylib), unless another forced extension is already selected. |
| 2522 | # .dylib is plainly wrong, and .bundle is used by loadable_modules in |
| 2523 | # bundle wrappers (com.apple.product-type.bundle). .so seems an odd |
| 2524 | # choice because it's used as the extension on many other systems that |
| 2525 | # don't distinguish between linkable shared libraries and non-linkable |
| 2526 | # loadable modules, but there's precedent: Python loadable modules on |
| 2527 | # Mac OS X use an .so extension. |
| 2528 | if self._properties["productType"] == "com.googlecode.gyp.xcode.bundle": |
| 2529 | self._properties["productType"] = ( |
| 2530 | "com.apple.product-type.library.dynamic" |
| 2531 | ) |
| 2532 | self.SetBuildSetting("MACH_O_TYPE", "mh_bundle") |
| 2533 | self.SetBuildSetting("DYLIB_CURRENT_VERSION", "") |
| 2534 | self.SetBuildSetting("DYLIB_COMPATIBILITY_VERSION", "") |
| 2535 | if force_extension is None: |
nothing calls this directly
no test coverage detected