peachsim 0.1.1808 → 0.1.1812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/cli/app-bundle-resources.ts +15 -2
- package/cli/cloud-box-artifact.ts +115 -0
- package/cli/cloud-client.ts +148 -76
- package/cli/cloud-dispatch.ts +4 -4
- package/cli/cloud-session.ts +60 -22
- package/cli/commands/box.ts +8 -2
- package/cli/commands/compat.ts +7 -4
- package/cli/commands/control.ts +69 -3
- package/cli/commands/coverage.ts +14 -4
- package/cli/commands/daemon.ts +41 -0
- package/cli/commands/no-bridge-hint.ts +9 -0
- package/cli/commands/package.ts +31 -56
- package/cli/commands/platform.ts +71 -60
- package/cli/commands/preview.ts +73 -24
- package/cli/commands/record.ts +10 -2
- package/cli/commands/screenshot.ts +17 -60
- package/cli/commands/setup.ts +3 -1
- package/cli/commands/three-mode.ts +22 -12
- package/cli/commands/upload.ts +2 -1
- package/cli/desktop-companion.ts +6 -1
- package/cli/drivers/desktop.ts +4 -1
- package/cli/main.ts +12 -2
- package/cli/metro-bundle-assets.ts +14 -4
- package/cli/outbound-endpoints.ts +7 -3
- package/cli/output-redaction.ts +38 -0
- package/cli/privacy.ts +2 -2
- package/cli/recording-access.ts +5 -0
- package/cli/remote-project-bundle.ts +83 -0
- package/cli/shell-init.ts +7 -11
- package/cli/telemetry.ts +41 -4
- package/cli/usage-error.ts +3 -0
- package/cli/ws-bridge.ts +42 -6
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +42897 -40755
- package/dist-lib/capture-contract.cjs +7 -8
- package/dist-lib/capture-contract.mjs +7 -8
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +13 -7
- package/dist-lib/dev-bundle-resolution.cjs +10 -4
- package/dist-lib/expo-swift-bundle.cjs +15889 -15553
- package/dist-lib/expo-swift-metadata.cjs +2 -1
- package/dist-lib/expo-swift-metadata.mjs +2 -1
- package/dist-lib/home-paths.cjs +2 -33
- package/dist-lib/host/bridge-host.cjs +20891 -18714
- package/dist-lib/host/fetch-proxy-handler.cjs +10 -11
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +620 -553
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +57 -28
- package/dist-lib/native-app-identity-project.cjs +47 -14
- package/dist-lib/native-app-identity-project.mjs +55 -20
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +27 -26
- package/dist-lib/public-origins-lib.json +104 -81
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +30700 -24410
- package/dist-lib/swift-compile.cjs +336 -222
- package/dist-lib/swift-compile.mjs +378 -263
- package/dist-lib/swift-package.cjs +19 -7
- package/dist-lib/swift-package.mjs +16 -6
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +49 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +19213 -18937
- package/dist-lib/vite.cjs +11 -12
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/expo-manifest.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -1
- package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +2 -1
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVFoundation+MPNowPlayingInfoLanguageOptionAdditions.h +39 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVPlayerItem+MediaPlayerAdditions.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPContentItem.h +67 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPError.h +33 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaEntity.h +53 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h +346 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItemCollection.h +42 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaLibrary.h +76 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPickerController.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlayback.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlaylist.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuery.h +120 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuerySection.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerController.h +444 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerViewController.h +43 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerApplicationController.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerController.h +147 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerQueueDescriptor.h +75 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h +197 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoLanguageOption.h +107 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingSession.h +89 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDataSource.h +59 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDelegate.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManager.h +46 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManagerContext.h +32 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommand.h +143 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandCenter.h +66 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandEvent.h +128 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteControlTypes.h +27 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeSettings.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeView.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes +74 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.h +40 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayerDefines.h +84 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/NSUserActivity+MediaPlayerAdditions.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIButtonConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +5 -5
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +12 -50
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewControllerLayoutEnvironment.h +2 -8
- package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +62 -0
- package/sdk/ios/usr/include/dispatch.modulemap +22 -0
- package/sdk/ios/usr/include/module.modulemap +8 -3
- package/sdk/ios/usr/include/net/if.h +24 -0
- package/sdk/ios/usr/include/sys/time.h +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +265 -0
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
- package/sdk/ios/wasm/include/fcntl.h +2 -0
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/stdlib.h +2 -0
- package/sdk/ios/wasm/include/unistd.h +2 -2
- package/skills/contrast/SKILL.md +2 -2
- package/src/bundle-channel.mjs +9 -72
- package/src/capture-contract.ts +12 -9
- package/src/desktop-host-delivery.ts +16 -2
- package/src/dev-bundle-resolution.ts +12 -3
- package/src/expo-native-workspace.ts +113 -46
- package/src/expo-swift-host.ts +17 -12
- package/src/expo-swift-ready.ts +4 -1
- package/src/expoSwiftContract.ts +1 -0
- package/src/home-paths.ts +4 -48
- package/src/host/bridge-host.ts +1 -0
- package/src/installed-native-libraries.ts +2 -8
- package/src/metro-project-root.ts +2 -1
- package/src/native-bundles.ts +122 -0
- package/src/native-static-libraries.ts +65 -8
- package/src/nitro-adapter.lock.json +272 -272
- package/src/nitro-bundle.ts +2 -2
- package/src/nitro-compile.ts +68 -28
- package/src/nitro-source.ts +24 -6
- package/src/nitro-superset.lock.json +94 -34
- package/src/nitroContract.ts +3 -0
- package/src/podspec-sources.ts +1966 -0
- package/src/storageSnapshotContract.ts +40 -0
- package/src/swift-compile.ts +77 -26
- package/src/swift-design-time.ts +18 -1
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-distribution.ts +9 -6
- package/src/swift-host.ts +1 -2
- package/src/swift-link-roots.ts +13 -2
- package/src/swift-objc-compile.ts +12 -0
- package/src/swift-objc-standin.ts +321 -114
- package/src/swift-package-manifest.ts +4 -3
- package/src/swift-package.ts +31 -4
- package/src/swift-root-lock.ts +11 -0
- package/src/swift-shared-sdk.ts +10 -9
- package/src/swift-source-pods.ts +2 -2
- package/src/swift-standins.ts +40 -143
- package/src/swift-toolchain.ts +59 -0
- package/src/swift-wasm-prune.ts +53 -21
- package/src/turbo-bundle.ts +4 -5
- package/src/turbo-codegen-intake.ts +111 -108
- package/src/turbo-compile.ts +63 -33
- package/src/turbo-runtime.lock.json +22 -22
- package/src/turbo-source.ts +171 -76
- package/src/wasm-optimize.ts +31 -2
- package/src/xcode-project.ts +65 -15
|
@@ -67,6 +67,46 @@ export const RESET_ASYNC_STORAGE_PREFIXES = [
|
|
|
67
67
|
export const RESET_MMKV_STORAGE_PREFIX = '@sootsim_mmkv:'
|
|
68
68
|
export const RESET_USER_DEFAULTS_PREFIX = 'rn-default-preference:'
|
|
69
69
|
|
|
70
|
+
// the record behind one UserDefaults key. Swift Foundation, PeachPreferences
|
|
71
|
+
// and every seam that fronts an app-group suite address it through this key,
|
|
72
|
+
// so a write from either side is the other side's read.
|
|
73
|
+
export function swiftPreferenceStorageKey(suiteName: string | null, key: string): string {
|
|
74
|
+
return RESET_USER_DEFAULTS_PREFIX + 'peach-swift:' + JSON.stringify([suiteName, key])
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// app-group defaults were once kept per suite and key under this prefix as the
|
|
78
|
+
// raw string (`<encoded group>:<encoded key>`), outside the Swift record. Each
|
|
79
|
+
// storage object moves them into the record the first time a seam or the
|
|
80
|
+
// Swift host reaches it, so values persisted before the shared record stay
|
|
81
|
+
// readable. A value already in the record wins; the legacy copy is dropped
|
|
82
|
+
// either way. encodeURIComponent escapes ':', so the split is exact. A storage
|
|
83
|
+
// counts as migrated only after every legacy key moved, so a failed storage
|
|
84
|
+
// operation leaves the remaining copies in place and the next call retries
|
|
85
|
+
// them; the record-wins rule makes the retry safe after a partial pass.
|
|
86
|
+
const LEGACY_APP_GROUP_PREFIX = '@sootsim:shared-group-preferences:'
|
|
87
|
+
const legacyAppGroupMigrated = new WeakSet<Storage>()
|
|
88
|
+
|
|
89
|
+
export function migrateLegacyAppGroupDefaults(storage: Storage): void {
|
|
90
|
+
if (legacyAppGroupMigrated.has(storage)) return
|
|
91
|
+
const legacyKeys: string[] = []
|
|
92
|
+
for (let index = 0; index < storage.length; index++) {
|
|
93
|
+
const key = storage.key(index)
|
|
94
|
+
if (key?.startsWith(LEGACY_APP_GROUP_PREFIX)) legacyKeys.push(key)
|
|
95
|
+
}
|
|
96
|
+
for (const legacyKey of legacyKeys) {
|
|
97
|
+
const parts = legacyKey.slice(LEGACY_APP_GROUP_PREFIX.length).split(':')
|
|
98
|
+
if (parts.length !== 2) continue
|
|
99
|
+
const [group, key] = parts.map(decodeURIComponent)
|
|
100
|
+
const value = storage.getItem(legacyKey)
|
|
101
|
+
const recordKey = swiftPreferenceStorageKey(group, key)
|
|
102
|
+
if (value !== null && storage.getItem(recordKey) === null) {
|
|
103
|
+
storage.setItem(recordKey, JSON.stringify({ kind: 'string', string: value }))
|
|
104
|
+
}
|
|
105
|
+
storage.removeItem(legacyKey)
|
|
106
|
+
}
|
|
107
|
+
legacyAppGroupMigrated.add(storage)
|
|
108
|
+
}
|
|
109
|
+
|
|
70
110
|
export type ResetStorageKind =
|
|
71
111
|
| 'async-storage'
|
|
72
112
|
| 'mmkv'
|
package/src/swift-compile.ts
CHANGED
|
@@ -24,7 +24,6 @@ import os from 'node:os'
|
|
|
24
24
|
import path from 'node:path'
|
|
25
25
|
import { windowAdmission } from './admitted-mac-build'
|
|
26
26
|
import cPredefinesJson from './generated/swift-c-predefines.json' with { type: 'json' }
|
|
27
|
-
import { swiftCacheDir, swiftPackageCacheOptions } from './home-paths'
|
|
28
27
|
import { terminateProcessGroup } from './process-group'
|
|
29
28
|
import {
|
|
30
29
|
reapRetiredCacheDirectory,
|
|
@@ -78,6 +77,8 @@ import {
|
|
|
78
77
|
clangImportNames,
|
|
79
78
|
clangMacroSetting,
|
|
80
79
|
clangSettingEntries,
|
|
80
|
+
fmtConstantInterpreterFlags,
|
|
81
|
+
withoutGlogModuleMap,
|
|
81
82
|
SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
82
83
|
type SwiftPackageTarget,
|
|
83
84
|
} from './swift-package'
|
|
@@ -98,7 +99,9 @@ import {
|
|
|
98
99
|
import {
|
|
99
100
|
sourceSwiftCheckout,
|
|
100
101
|
SWIFT_AUTOLINK_LINKER,
|
|
102
|
+
swiftCacheDir,
|
|
101
103
|
swiftEnvironment,
|
|
104
|
+
swiftPackageCacheOptions,
|
|
102
105
|
swiftSdkOptions,
|
|
103
106
|
swiftSourceSdk,
|
|
104
107
|
swiftToolchain,
|
|
@@ -363,8 +366,9 @@ export function swiftDistributionAt(root: string): SwiftDistributionManifest | n
|
|
|
363
366
|
/**
|
|
364
367
|
* the Objective-C interface an SDK module defines: the names Swift owns and
|
|
365
368
|
* its generated header. a distribution ships the header; a source checkout
|
|
366
|
-
* names them by `@objc(Name)` and
|
|
367
|
-
* (`.build/host`)
|
|
369
|
+
* names them by `@objc(Name)` and reads the header its module build emitted
|
|
370
|
+
* (`.build/host`). a module with no emitted header has no interface in either,
|
|
371
|
+
* so its original Objective-C headers keep their declarations.
|
|
368
372
|
*/
|
|
369
373
|
export function swiftModuleInterface(
|
|
370
374
|
moduleRoot: string,
|
|
@@ -381,22 +385,21 @@ export function swiftModuleInterface(
|
|
|
381
385
|
return { declared: swiftInterfaceDeclarations(header), header }
|
|
382
386
|
}
|
|
383
387
|
const sources = path.join(moduleRoot, 'Sources', name)
|
|
384
|
-
|
|
388
|
+
const built = path.join(moduleRoot, '.build/host', `${name}-Swift.h`)
|
|
389
|
+
if (!existsSync(sources) || !existsSync(built)) return null
|
|
385
390
|
const declared = new Set<string>()
|
|
386
391
|
for (const file of readdirSync(sources, { recursive: true, encoding: 'utf8' }))
|
|
387
392
|
if (file.endsWith('.swift'))
|
|
388
|
-
|
|
389
|
-
|
|
393
|
+
// an NSObject subclass is an Objective-C class named as it is in Swift
|
|
394
|
+
for (const [, objc, subclass] of readFileSync(
|
|
395
|
+
path.join(sources, file),
|
|
396
|
+
'utf8',
|
|
397
|
+
).matchAll(
|
|
398
|
+
/@objc\((\w+)\)\s+(?:\w+\s+)*?(?:protocol|class)\s|^(?:public|open)\s+(?:final\s+)?class\s+(\w+)\s*:\s*NSObject\b/gm,
|
|
390
399
|
))
|
|
391
|
-
declared.add(objc!)
|
|
400
|
+
declared.add((objc ?? subclass)!)
|
|
392
401
|
if (declared.size === 0) return null
|
|
393
|
-
|
|
394
|
-
return {
|
|
395
|
-
declared,
|
|
396
|
-
header: existsSync(built)
|
|
397
|
-
? clangInterfaceHeader(readFileSync(built, 'utf8'))
|
|
398
|
-
: `// ${name}-Swift.h is generated when ${name} builds\n`,
|
|
399
|
-
}
|
|
402
|
+
return { declared, header: clangInterfaceHeader(readFileSync(built, 'utf8')) }
|
|
400
403
|
}
|
|
401
404
|
|
|
402
405
|
// the compiler imports the module that defines a type, and UIKit's declarations
|
|
@@ -697,14 +700,16 @@ export function swiftProjectBuildKey(moduleRoot: string, release: string): strin
|
|
|
697
700
|
// clang autolinks the library a system module map names when a unit imports
|
|
698
701
|
// one of its headers, so an ios target links it without declaring it. swiftpm
|
|
699
702
|
// on wasm reads no clang autolinks, so the target declares the library the ios
|
|
700
|
-
// module map names: SQLite3 links sqlite3, which the wasm
|
|
703
|
+
// module map names: SQLite3 links sqlite3 and bzlib.h links bz2, which the wasm
|
|
704
|
+
// sdk ships.
|
|
701
705
|
const SYSTEM_MODULE_LIBRARIES: Record<string, string> = {
|
|
702
706
|
'sqlite3.h': 'sqlite3',
|
|
703
707
|
'sqlite3ext.h': 'sqlite3',
|
|
708
|
+
'bzlib.h': 'bz2',
|
|
704
709
|
SQLite3: 'sqlite3',
|
|
705
710
|
}
|
|
706
711
|
const SYSTEM_MODULE_IMPORT =
|
|
707
|
-
/^\s*(?:#\s*(?:import|include)\s*<(sqlite3(?:ext)?\.h)>|@import\s+(SQLite3)\b)/gm
|
|
712
|
+
/^\s*(?:#\s*(?:import|include)\s*<(sqlite3(?:ext)?\.h|bzlib\.h)>|@import\s+(SQLite3)\b)/gm
|
|
708
713
|
|
|
709
714
|
export function compileTargets(input: SwiftCompileInput): SwiftPackageTarget[] {
|
|
710
715
|
const manifest = input.files['Package.swift']
|
|
@@ -1251,6 +1256,17 @@ export function swiftTargetDependencies(
|
|
|
1251
1256
|
const siblings = new Map<string, string[]>()
|
|
1252
1257
|
for (const target of targets) {
|
|
1253
1258
|
const prefix = target.path === '.' ? '' : `${target.path}/`
|
|
1259
|
+
const ownsHeader = (header: string) =>
|
|
1260
|
+
[`${prefix}${header}`, `${prefix}include/${header}`].some(
|
|
1261
|
+
(file) =>
|
|
1262
|
+
Object.hasOwn(files, file) &&
|
|
1263
|
+
!targets.some(
|
|
1264
|
+
(candidate) =>
|
|
1265
|
+
candidate.name !== target.name &&
|
|
1266
|
+
candidate.path !== '.' &&
|
|
1267
|
+
file.startsWith(`${candidate.path}/`),
|
|
1268
|
+
),
|
|
1269
|
+
)
|
|
1254
1270
|
const deps = new Set(
|
|
1255
1271
|
(target.dependencies ?? []).flatMap((dependency) =>
|
|
1256
1272
|
dependency.kind === 'target' &&
|
|
@@ -1275,7 +1291,7 @@ export function swiftTargetDependencies(
|
|
|
1275
1291
|
const imports = file.endsWith('.swift')
|
|
1276
1292
|
? swiftImportNames(contents)
|
|
1277
1293
|
: SWIFT_NATIVE_SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension))
|
|
1278
|
-
? clangImportNames(contents)
|
|
1294
|
+
? clangImportNames(contents, ownsHeader)
|
|
1279
1295
|
: []
|
|
1280
1296
|
for (const name of imports) {
|
|
1281
1297
|
if (names.has(name) && name !== target.name) deps.add(name)
|
|
@@ -1344,7 +1360,7 @@ const darwinRecordsRegion = (quoted: readonly string[]): string[] =>
|
|
|
1344
1360
|
const REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n'
|
|
1345
1361
|
|
|
1346
1362
|
/** bump with any change to the emitted multi-target manifest text. */
|
|
1347
|
-
export const MULTI_MANIFEST_VERSION =
|
|
1363
|
+
export const MULTI_MANIFEST_VERSION = 65
|
|
1348
1364
|
const SWIFT_HEADER_PRODUCTS_TARGET = 'PeachHeaderProducts'
|
|
1349
1365
|
|
|
1350
1366
|
// build-cli replaces this in every bundle; source runs read the files directly.
|
|
@@ -1440,6 +1456,18 @@ export function swiftArtifactHash(
|
|
|
1440
1456
|
return hash.digest('hex')
|
|
1441
1457
|
}
|
|
1442
1458
|
|
|
1459
|
+
const nativeCxxCompilerFlags = ['-fno-cxx-modules']
|
|
1460
|
+
|
|
1461
|
+
// swiftpm gives every clang unit, c++ included, the target's cSettings flags.
|
|
1462
|
+
const cFlagArray = (flags: readonly string[]): string =>
|
|
1463
|
+
JSON.stringify(withoutGlogModuleMap(flags))
|
|
1464
|
+
const cxxFlagArray = (flags: readonly string[]): string =>
|
|
1465
|
+
JSON.stringify([
|
|
1466
|
+
...nativeCxxCompilerFlags,
|
|
1467
|
+
...fmtConstantInterpreterFlags(flags),
|
|
1468
|
+
...withoutGlogModuleMap(flags),
|
|
1469
|
+
])
|
|
1470
|
+
|
|
1443
1471
|
interface SwiftNativeTargetPlan {
|
|
1444
1472
|
path: string
|
|
1445
1473
|
includeDirectory: string
|
|
@@ -1896,16 +1924,16 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1896
1924
|
)
|
|
1897
1925
|
const nativeSettings = native?.clang
|
|
1898
1926
|
? [
|
|
1899
|
-
`cSettings: [${cDefines} .unsafeFlags(${flagArray(
|
|
1927
|
+
`cSettings: [${cDefines} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, ...native.clang.flags]))})]`,
|
|
1900
1928
|
...(nativeCxx
|
|
1901
1929
|
? [
|
|
1902
|
-
`cxxSettings: [${cxxDefines} .unsafeFlags(${flagArray(
|
|
1930
|
+
`cxxSettings: [${cxxDefines} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), ...native.clang.cxxFlags]))})]`,
|
|
1903
1931
|
]
|
|
1904
1932
|
: []),
|
|
1905
1933
|
].join(', ')
|
|
1906
1934
|
: [
|
|
1907
|
-
`cSettings: [${cDefines}${declaredClangSettings(target, 'c')} .unsafeFlags(${flagArray(
|
|
1908
|
-
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, 'cxx')} .unsafeFlags(${flagArray(
|
|
1935
|
+
`cSettings: [${cDefines}${declaredClangSettings(target, 'c')} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, ...(native?.flags ?? [])]))})]`,
|
|
1936
|
+
`cxxSettings: [${cxxDefines}${declaredClangSettings(target, 'cxx')} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), ...(native?.cxxFlags ?? [])]))})]`,
|
|
1909
1937
|
].join(', ')
|
|
1910
1938
|
const exclusions = native?.clang
|
|
1911
1939
|
? []
|
|
@@ -1992,10 +2020,10 @@ export function emitSwiftPackageManifest(args: {
|
|
|
1992
2020
|
` path: ${JSON.stringify(group.path)},`,
|
|
1993
2021
|
` sources: ${JSON.stringify(group.sources)},`,
|
|
1994
2022
|
' publicHeadersPath: "include",',
|
|
1995
|
-
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, 'c')} .unsafeFlags(${flagArray(
|
|
2023
|
+
` cSettings: [${macroSettings(owner?.cDefines)}${declaredClangSettings(owner, 'c')} .unsafeFlags(${flagArray(cFlagArray([...nativeFlags, '-I', native.includeDirectory, ...(args.headerDirectory ? ['-I', args.headerDirectory] : []), ...group.flags]))})],`,
|
|
1996
2024
|
...(group.sources.some((source) => /\.(?:cc|cpp|cxx|mm)$/.test(source))
|
|
1997
2025
|
? [
|
|
1998
|
-
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, 'cxx')} .unsafeFlags(${flagArray(
|
|
2026
|
+
` cxxSettings: [${macroSettings(owner?.cxxDefines)}${declaredClangSettings(owner, 'cxx')} .unsafeFlags(${flagArray(cxxFlagArray([...cxxFlagsFor(nativeFlags), ...group.cxxFlags]))})]),`,
|
|
1999
2027
|
]
|
|
2000
2028
|
: [' ),']),
|
|
2001
2029
|
])
|
|
@@ -4113,6 +4141,22 @@ export function writeSwiftProject(
|
|
|
4113
4141
|
moduleInterfaces.set(name, value)
|
|
4114
4142
|
return value
|
|
4115
4143
|
}
|
|
4144
|
+
const podHeaders = new Map<string, { owner: string; content: unknown }[]>()
|
|
4145
|
+
for (const settings of input.nativeTargets ?? [])
|
|
4146
|
+
for (const file of settings.headers) {
|
|
4147
|
+
const owner = /\/Headers\/(?:Public|Private)\/([\w+-]+)\/(?:\1\/)?[^/]+\.h$/.exec(
|
|
4148
|
+
file,
|
|
4149
|
+
)?.[1]
|
|
4150
|
+
if (owner)
|
|
4151
|
+
podHeaders.set(path.basename(file), [
|
|
4152
|
+
...(podHeaders.get(path.basename(file)) ?? []),
|
|
4153
|
+
{ owner, content: input.files[file] },
|
|
4154
|
+
])
|
|
4155
|
+
}
|
|
4156
|
+
const podHeaderOwner = (file: string, content: unknown): string | undefined =>
|
|
4157
|
+
/\/Headers\/(?:Public|Private)\/([\w+-]+)\//.exec(file)?.[1] ??
|
|
4158
|
+
podHeaders.get(path.basename(file))?.find((header) => header.content === content)
|
|
4159
|
+
?.owner
|
|
4116
4160
|
// headers keep their original project paths. an xcode target's product
|
|
4117
4161
|
// headers additionally occupy the flat Module/Header.h namespace it
|
|
4118
4162
|
// publishes; a swiftpm target's stay under its public headers directory.
|
|
@@ -4126,7 +4170,14 @@ export function writeSwiftProject(
|
|
|
4126
4170
|
const frameworkHeader =
|
|
4127
4171
|
!interfaceModule &&
|
|
4128
4172
|
/(?:^|\/)(\w+)\.framework\/Headers\/[\w+.-]+\.h$/.exec(file)?.[1]
|
|
4129
|
-
|
|
4173
|
+
// a source pod whose module the distribution provides as Swift takes
|
|
4174
|
+
// the declarations Swift owns from the module's interface header. a pod
|
|
4175
|
+
// header is owned by the pod whose public header directory holds it, and
|
|
4176
|
+
// its original source by the same content there.
|
|
4177
|
+
const interfaceOwner =
|
|
4178
|
+
frameworkHeader ||
|
|
4179
|
+
(interfaceModule ? undefined : podHeaderOwner(file, input.files[file]))
|
|
4180
|
+
const frameworkInterface = interfaceOwner ? moduleInterface(interfaceOwner) : null
|
|
4130
4181
|
const rawContents =
|
|
4131
4182
|
(interfaceModule && moduleInterface(interfaceModule)?.header) || input.files[file]
|
|
4132
4183
|
if (rawContents === undefined)
|
|
@@ -4136,7 +4187,7 @@ export function writeSwiftProject(
|
|
|
4136
4187
|
? withoutSwiftDeclarations(
|
|
4137
4188
|
rawContents,
|
|
4138
4189
|
frameworkInterface.declared,
|
|
4139
|
-
`#import <${
|
|
4190
|
+
`#import <${interfaceOwner}/${interfaceOwner}-Swift.h>`,
|
|
4140
4191
|
)
|
|
4141
4192
|
: rawContents
|
|
4142
4193
|
writeBuildFile(destination, contents)
|
package/src/swift-design-time.ts
CHANGED
|
@@ -291,7 +291,24 @@ export function designTimeSites(source: string): DesignTimeSite[] {
|
|
|
291
291
|
while (t < to && tokens[t]!.kind !== 'newline') t++
|
|
292
292
|
continue
|
|
293
293
|
}
|
|
294
|
-
|
|
294
|
+
const availability = word === '#available' || word === '#unavailable'
|
|
295
|
+
t++
|
|
296
|
+
// expression macros may have generic arguments and a trailing closure.
|
|
297
|
+
// their expansion sees syntax, so keep all of that syntax intact.
|
|
298
|
+
if (
|
|
299
|
+
!availability &&
|
|
300
|
+
text(source, tokens[t]) === '<' &&
|
|
301
|
+
tokens[t]!.start === token.end
|
|
302
|
+
) {
|
|
303
|
+
let depth = 0
|
|
304
|
+
do {
|
|
305
|
+
const p = text(source, tokens[t++])
|
|
306
|
+
if (p === '<') depth++
|
|
307
|
+
else if (p === '>') depth--
|
|
308
|
+
} while (t < to && depth > 0)
|
|
309
|
+
}
|
|
310
|
+
if (text(source, tokens[t]) === '(') t = skipGroup(t)
|
|
311
|
+
if (!availability && text(source, tokens[t]) === '{') t = skipGroup(t)
|
|
295
312
|
continue
|
|
296
313
|
}
|
|
297
314
|
if (token.kind === 'at') {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
3
|
-
"release": "swift-6.4.0-RELEASE-custom-
|
|
4
|
-
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-
|
|
5
|
-
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-
|
|
6
|
-
"wasmSdkChecksum": "
|
|
7
|
-
"source": "
|
|
2
|
+
"id": "af69e0877dcfc948",
|
|
3
|
+
"release": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
|
|
4
|
+
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-5d385b68",
|
|
5
|
+
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-5d385b68.artifactbundle.tar.gz",
|
|
6
|
+
"wasmSdkChecksum": "d91882af99821a296c3db4459896b46ceaef37e9a30caad14e5f24cf6b964ae9",
|
|
7
|
+
"source": "85e7a5155755f4400d2bd7010abdd09f62dd6f34",
|
|
8
8
|
"targets": [
|
|
9
9
|
"ImagePlayground",
|
|
10
10
|
"QuickLookThumbnailing",
|
|
@@ -230,16 +230,16 @@
|
|
|
230
230
|
},
|
|
231
231
|
"hosts": {
|
|
232
232
|
"darwin-arm64": {
|
|
233
|
-
"sha256": "
|
|
234
|
-
"size":
|
|
233
|
+
"sha256": "dd96208b7ea40e1d8e93d61a716e30191a5e57800074e65837222c042617b96e",
|
|
234
|
+
"size": 99097618
|
|
235
235
|
},
|
|
236
236
|
"linux-x64": {
|
|
237
|
-
"sha256": "
|
|
238
|
-
"size":
|
|
237
|
+
"sha256": "bd0ef2a7d0fab414a415a9c2619c0c8c890b792856b1cbdb158a6f74b8d75502",
|
|
238
|
+
"size": 101817050
|
|
239
239
|
},
|
|
240
240
|
"linux-arm64": {
|
|
241
|
-
"sha256": "
|
|
242
|
-
"size":
|
|
241
|
+
"sha256": "37006a7363e6af15a31c65afaa3d6e0480bdd59c5d835f923e44e69dcae81e53",
|
|
242
|
+
"size": 101308927
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
}
|
|
@@ -319,16 +319,19 @@ export async function resolveSwiftModule({
|
|
|
319
319
|
return { root, ...swiftModuleToolchain(root) }
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
/** the
|
|
323
|
-
export function
|
|
324
|
-
release: string
|
|
325
|
-
toolchainBin: string
|
|
326
|
-
} {
|
|
322
|
+
/** the host compiler selected by a module root, without requiring a guest SDK. */
|
|
323
|
+
export function swiftModuleCompiler(root: string): Omit<SwiftModule, 'root'> {
|
|
327
324
|
const pin: { release: string } =
|
|
328
325
|
swiftDistributionAt(root) ??
|
|
329
326
|
JSON.parse(fs.readFileSync(path.join(root, 'toolchain.json'), 'utf8'))
|
|
330
327
|
return {
|
|
331
328
|
release: pin.release,
|
|
332
|
-
toolchainBin:
|
|
329
|
+
toolchainBin: swiftCompiler(pin.release),
|
|
333
330
|
}
|
|
334
331
|
}
|
|
332
|
+
|
|
333
|
+
/** the release a module root was built for and its installed toolchain. */
|
|
334
|
+
export function swiftModuleToolchain(root: string): Omit<SwiftModule, 'root'> {
|
|
335
|
+
const { release } = swiftModuleCompiler(root)
|
|
336
|
+
return { release, toolchainBin: swiftToolchain(release, swiftModuleSdk(root)) }
|
|
337
|
+
}
|
package/src/swift-host.ts
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
resolveSwiftImageResourceUrls,
|
|
15
15
|
} from '../../sootsim-swift/src/bundleAssets'
|
|
16
16
|
import { compileStringCatalog } from '../../sootsim-swift/src/stringCatalog'
|
|
17
|
-
import { swiftCacheDir } from './home-paths'
|
|
18
17
|
import iosSdk from './ios-sdk-frameworks.json' with { type: 'json' }
|
|
19
18
|
import { type NativeAppIdentity } from './native-app-identity'
|
|
20
19
|
import { readNativeAppIdentityFromXcodeTarget } from './native-app-identity-project'
|
|
@@ -112,7 +111,7 @@ import {
|
|
|
112
111
|
type SwiftImageUpload,
|
|
113
112
|
type SwiftNativeModules,
|
|
114
113
|
} from './swift-submit'
|
|
115
|
-
import { privateSwiftDistributionRoot } from './swift-toolchain'
|
|
114
|
+
import { privateSwiftDistributionRoot, swiftCacheDir } from './swift-toolchain'
|
|
116
115
|
import { swiftProjectFileProblem } from './swiftContract'
|
|
117
116
|
import {
|
|
118
117
|
SWIFT_NATIVE_INPUT_ROOT,
|
package/src/swift-link-roots.ts
CHANGED
|
@@ -21,14 +21,17 @@ const leb = (bytes: Uint8Array, at: { offset: number }): number => {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// data segment name to its summed size in one wasm object, plus
|
|
25
|
-
// the object defines a wasm-exported symbol
|
|
24
|
+
// data segment name to its summed size in one wasm object, plus sentinels when
|
|
25
|
+
// the object defines a wasm-exported symbol or a named ObjC category. a Swift
|
|
26
|
+
// extension's category fills its segment's empty-terminator size exactly, so
|
|
27
|
+
// only its symbol shows it. the linking section names each
|
|
26
28
|
// segment and the data section sizes them in the same order.
|
|
27
29
|
function objcSegmentSizes(bytes: Uint8Array): Map<string, number> {
|
|
28
30
|
const at = { offset: 8 }
|
|
29
31
|
const names: string[] = []
|
|
30
32
|
const sizes: number[] = []
|
|
31
33
|
let hasExportedSymbol = false
|
|
34
|
+
let definesCategory = false
|
|
32
35
|
while (at.offset < bytes.length) {
|
|
33
36
|
const id = bytes[at.offset++]!
|
|
34
37
|
const size = leb(bytes, at)
|
|
@@ -68,6 +71,13 @@ function objcSegmentSizes(bytes: Uint8Array): Map<string, number> {
|
|
|
68
71
|
}
|
|
69
72
|
} else if (symKind === 1) {
|
|
70
73
|
const sLen = leb(bytes, at)
|
|
74
|
+
if (
|
|
75
|
+
!isUndef &&
|
|
76
|
+
Buffer.from(bytes.subarray(at.offset, at.offset + sLen))
|
|
77
|
+
.toString()
|
|
78
|
+
.startsWith('.objc_category_')
|
|
79
|
+
)
|
|
80
|
+
definesCategory = true
|
|
71
81
|
at.offset += sLen
|
|
72
82
|
if (!isUndef) {
|
|
73
83
|
leb(bytes, at)
|
|
@@ -105,6 +115,7 @@ function objcSegmentSizes(bytes: Uint8Array): Map<string, number> {
|
|
|
105
115
|
result.set(name, (result.get(name) ?? 0) + (sizes[index] ?? 0))
|
|
106
116
|
})
|
|
107
117
|
result.set('__wasm_exported', hasExportedSymbol ? 1 : 0)
|
|
118
|
+
result.set('__objc_category', definesCategory ? 1 : 0)
|
|
108
119
|
return result
|
|
109
120
|
}
|
|
110
121
|
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
swiftModuleSdk,
|
|
13
13
|
swiftModuleDigest,
|
|
14
14
|
swiftPeachModules,
|
|
15
|
+
swiftDistributionAt,
|
|
16
|
+
FOUNDATION_IMPLICIT_MODULES,
|
|
15
17
|
} from './swift-compile'
|
|
16
18
|
import { swiftModuleToolchain } from './swift-distribution'
|
|
17
19
|
import { swiftClangImporterFlags } from './swift-objc-import'
|
|
@@ -22,6 +24,7 @@ import {
|
|
|
22
24
|
SWIFT_NATIVE_SOURCE_EXTENSIONS,
|
|
23
25
|
swiftTargetModuleName,
|
|
24
26
|
} from './swift-package'
|
|
27
|
+
import { fmtConstantInterpreterFlags } from './swift-package'
|
|
25
28
|
import { swiftPackageManifest, swiftTargetFiles } from './swift-package-manifest'
|
|
26
29
|
import { remoteSwiftCheckouts, type SwiftPackageBinary } from './swift-packages'
|
|
27
30
|
import { readPackageFile, relativeInside } from './swift-source-file'
|
|
@@ -808,6 +811,11 @@ export function prepareXcodeSwiftProducts(
|
|
|
808
811
|
const sdk = swiftSdkPaths(moduleRoot, toolchain.toolchainBin)
|
|
809
812
|
const frontend = path.join(toolchain.toolchainBin, 'swift-frontend')
|
|
810
813
|
const supplied = new Set(swiftPeachModules(moduleRoot))
|
|
814
|
+
// every iOS source sees what darwin's Foundation re-exports, String: CVarArg
|
|
815
|
+
// included. a source checkout builds none of these modules.
|
|
816
|
+
const implicitImports = swiftDistributionAt(moduleRoot)
|
|
817
|
+
? FOUNDATION_IMPLICIT_MODULES.flatMap((module) => ['-import-module', module])
|
|
818
|
+
: []
|
|
811
819
|
const modules = path.join(moduleRoot, 'modules')
|
|
812
820
|
const {
|
|
813
821
|
sources,
|
|
@@ -1100,6 +1108,7 @@ export function prepareXcodeSwiftProducts(
|
|
|
1100
1108
|
...target.swift!.includePaths.flatMap((file) => ['-I', remap(file)]),
|
|
1101
1109
|
...clangFlags.flatMap((flag) => ['-Xcc', flag]),
|
|
1102
1110
|
...target.defines.flatMap((flag) => ['-D', flag]),
|
|
1111
|
+
...implicitImports,
|
|
1103
1112
|
...(target.mainActorIsolation ? ['-default-isolation', 'MainActor'] : []),
|
|
1104
1113
|
...(target.swift!.cxxInterop ? ['-cxx-interoperability-mode=default'] : []),
|
|
1105
1114
|
...swiftFlags,
|
|
@@ -1520,6 +1529,9 @@ export async function prepareXcodeObjCImplementations(
|
|
|
1520
1529
|
...(objc ? [...swiftObjCRuntimeFlags, '-fobjc-exceptions'] : []),
|
|
1521
1530
|
...objcSdkIntakeFlags(headers, toolchain.toolchainBin, minimum),
|
|
1522
1531
|
...headerSearch.flags[index]!,
|
|
1532
|
+
...(cxx
|
|
1533
|
+
? fmtConstantInterpreterFlags([...flags, ...headerSearch.flags[index]!])
|
|
1534
|
+
: []),
|
|
1523
1535
|
...target.includes.flatMap((include) => ['-I', staged(include)]),
|
|
1524
1536
|
...target.frameworks.flatMap((framework) => ['-F', staged(framework)]),
|
|
1525
1537
|
...moduleMaps[index]!,
|