jQrgen
08/21/2024, 8:38 AMFrançois
08/21/2024, 8:41 AMFrançois
08/21/2024, 8:44 AMjQrgen
08/21/2024, 8:44 AMjQrgen
08/21/2024, 8:44 AMFrançois
08/21/2024, 8:45 AMFrançois
08/21/2024, 8:47 AMjQrgen
08/21/2024, 8:48 AMjQrgen
08/21/2024, 8:48 AMjQrgen
08/21/2024, 8:52 AMFrançois
08/21/2024, 8:53 AMFrançois
08/21/2024, 8:54 AMval defFilRootPath = "iosDeps"
val frameworkRootPath = "$projectDir/iosDeps/Carthage/Build"
val armSimArch = "ios-arm64_x86_64-simulator"
val armDevArch = "ios-arm64"
iosSimulatorArm64 {
compilations.getByName("main") {
val KeePassKit by cinterops.creating {
// Path to .def file
defFile("$defFilRootPath/KeePassKit.def")
compilerOpts("-framework", "KeePassKit", "-F$frameworkRootPath/KeePassKit.xcframework/$armSimArch")
extraOpts += listOf("-compiler-option", "-fmodules")
}
val KissXML by cinterops.creating {
defFile("$defFilRootPath/KissXML.def")
compilerOpts("-framework", "KissXML", "-F$frameworkRootPath/KissXML.xcframework/$armSimArch")
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
binaries.all {
// Tell the linker where the framework is located.
linkerOpts(
"-ObjC",
"-framework",
"KeePassKit",
"-F$frameworkRootPath/KeePassKit.xcframework/$armSimArch",
"-framework",
"KissXML",
"-F$frameworkRootPath/KissXML.xcframework/$armSimArch",
)
}
}
François
08/21/2024, 8:55 AMcompilerOpts
is crucialFrançois
08/21/2024, 8:56 AMFrançois
08/21/2024, 8:57 AMjQrgen
08/21/2024, 8:57 AMFrançois
08/21/2024, 8:58 AMAn XCFramework bundle, or artifact, is a binary package created by Xcode that includes the frameworks and libraries necessary to build for multiple platforms (iOS, macOS, visionOS, tvOS, watchOS, and DriverKit), including Simulator builds. The frameworks can be static or dynamic and also include headers.
Include an XCFramework bundle inside a Swift package to distribute code in binary form for use in other projects. For more information, see Distributing binary frameworks as Swift packages.
<https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle>
François
08/21/2024, 9:00 AMFrançois
08/21/2024, 9:00 AMFrançois
08/21/2024, 9:01 AMjQrgen
08/21/2024, 9:01 AMjQrgen
08/21/2024, 9:02 AMFrançois
08/21/2024, 9:04 AMjQrgen
08/21/2024, 9:06 AMFrançois
08/21/2024, 9:09 AM