Files
Lyrebird/LiveCompile/Package.swift
T
josh 2fa4bfd45e Static consumer product + internal dynamic for LiveCompile
The Lyrebird product was forced type: .dynamic, forcing an SPM dynamic
framework on consumers and hitting the Xcode 26 regression
(PackageFrameworks/Lyrebird.framework binary missing). Split into two products
vending the same LyrebirdSynth target:
  • Lyrebird (automatic → static): consumer-facing, no framework, no workarounds.
  • LyrebirdDynamic (.dynamic): internal-only, consumed by LiveCompile.

LiveCompile repointed to LyrebirdDynamic with linker refs updated
(libLyrebirdDynamic.dylib). README + GettingStarted updated: consumers link
static and need no disable-library-validation entitlement or driver override.

Verified: core + LiveCompile (34/34) build/test clean; external consumer links
the static product with no dynamic dylib.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 21:06:02 -07:00

73 lines
2.3 KiB
Swift

// Package.swift
// Lyrebird
//
// Copyright (c) 2026 Joshua Parmenter / realizedsound
// SPDX-License-Identifier: MIT
// swift-tools-version: 6.0
import PackageDescription
// Phase 167 — `LyrebirdLiveCompile` and `LyrebirdLiveCompileUI` live in this
// sub-package so that cross-package `.product(name:, package:)` dependency
// resolution forces SwiftPM to dynamic-link `libLyrebirdLiveCompile.dylib`
// against `libLyrebird.dylib` instead of statically embedding `Lyrebird`'s
// classes (which caused ObjC class double-registration during `swift test`
// in the single-package layout).
//
// macOS-only — the host swiftc-shell-out + dlopen surface cannot run on iOS.
let package = Package(
name: "LyrebirdLiveCompile",
platforms: [.macOS(.v15)],
products: [
.library(
name: "LyrebirdLiveCompile",
type: .dynamic,
targets: ["LyrebirdLiveCompile"]
),
.library(
name: "LyrebirdLiveCompileUI",
targets: ["LyrebirdLiveCompileUI"]
),
],
dependencies: [
.package(name: "Lyrebird", path: "..")
],
targets: [
.target(
name: "LyrebirdLiveCompile",
dependencies: [
.product(name: "LyrebirdDynamic", package: "Lyrebird"),
],
path: "Sources/LyrebirdLiveCompile"
),
.target(
name: "LyrebirdLiveCompileUI",
dependencies: [
"LyrebirdLiveCompile",
.product(name: "LyrebirdDynamic", package: "Lyrebird"),
],
path: "Sources/LyrebirdLiveCompileUI",
swiftSettings: [.swiftLanguageMode(.v5)]
),
.testTarget(
name: "LyrebirdLiveCompileTests",
dependencies: [
"LyrebirdLiveCompile",
.product(name: "LyrebirdDynamic", package: "Lyrebird"),
],
path: "Tests/LyrebirdLiveCompileTests"
),
.testTarget(
name: "LyrebirdLiveCompileUITests",
dependencies: [
"LyrebirdLiveCompile",
"LyrebirdLiveCompileUI",
.product(name: "LyrebirdDynamic", package: "Lyrebird"),
],
path: "Tests/LyrebirdLiveCompileUITests",
swiftSettings: [.swiftLanguageMode(.v5)]
),
]
)