Closed fwcd closed 3 years ago
I assume this is on Swift 5.3
Your final executable also needs to link to BluetoothGATT, BluetoothGAP, and BluetoothHCI on macOS and Linux
@fwcd Add this to your CLI tool's dependencies:
.target(
name: "testtool",
dependencies: [
"Bluetooth",
.product(
name: "BluetoothGAP",
package: "Bluetooth"
),
.product(
name: "BluetoothGATT",
package: "Bluetooth"
),
.product(
name: "BluetoothHCI",
package: "Bluetooth"
),
.product(
name: "BluetoothLinux",
package: "BluetoothLinux",
condition: .when(platforms: [.linux])
),
.product(
name: "DarwinGATT",
package: "GATT",
condition: .when(platforms: [.macOS])
),
.product(
name: "BluetoothDarwin",
package: "BluetoothDarwin",
condition: .when(platforms: [.macOS])
)
]
)
A simple Swift project using the latest versions of
BluetoothLinux
andGATT
with the following main scriptcauses linking to fail: