Dumitru Preguza
12/23/2025, 10:42 PMDumitru Preguza
12/23/2025, 10:44 PMswiftPackageConfig {
create("spmMaplibre") {
dependency {
remotePackageVersion(
url = URI("<https://github.com/maplibre/maplibre-gl-native-distribution.git>"),
products = { add("MapLibre") },
version = "6.17.1",
)
}
}
}
then
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
val variant = when (iosTarget.targetName) {
"iosArm64" -> "arm64-apple-ios"
"iosSimulatorArm64" -> "arm64-apple-ios-simulator"
"iosX64" -> "x86_64-apple-ios-simulator"
else -> error("Unrecognized target: ${iosTarget.targetName}")
}
val rpath = "${project.layout.buildDirectory.get()}/spmKmpPlugin/spmMaplibre/scratch/$variant/release/"
iosTarget.compilations {
getByName("main") {
cinterops.create("spmMaplibre")
}
}
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
binaryOption("bundleId", "com.mafrend.app.compose")
linkerOpts("-F$rpath", "-rpath", rpath)
}
}François
12/24/2025, 8:56 AM