【发布时间】:2022-12-18 21:10:35
【问题描述】:
我有一个 swift 包,我想将它集成到我的 CI 中并从中创建一个静态库。
这是 Package.Swift 的样子:
import PackageDescription
let package = Package(
name: "CMyLibrary",
platforms: [
.iOS(.v11),
.watchOS(.v6),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "CMyLibrary",
targets: ["CMyLibrary"]),
],
dependencies: [],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "CMyLibrary",
dependencies: ["CWolfCrypt", "CWolfSsl"],
path: "Sources/CMyLibrary",
cSettings: [
.headerSearchPath("./"),
]),
.target(
name: "CWolfCrypt",
dependencies: [],
path: "Sources/CWolfCrypt",
cSettings: [
.headerSearchPath("./"),
]),
.target(
name: "CWolfSsl",
dependencies: ["CWolfCrypt"],
path: "Sources/CWolfSsl"),
],
cLanguageStandard: .c11
)
执行 swift build 命令会创建一个包含许多文件但不是静态库的构建文件夹。
我是否可以假设我应该能够从这个 swift 包中输出一个静态库?如果是,我该怎么做才能真正获得静态库(也许是一个 .a 文件?)
【问题讨论】:
标签: ios swift continuous-integration static-libraries swift-package-manager