// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "AlgorithmSDK",
platforms: [
.iOS(.v13)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages. , "AlgorithmSDKObjc"
.library(
name: "AlgorithmSDK",
targets: ["AlgorithmSDK","AlgorithmSDKObjc" ]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
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: "AlgorithmSDK",
dependencies: []),
.testTarget(
name: "AlgorithmSDKTests",
dependencies: ["AlgorithmSDK"]),
.target(
name: "AlgorithmSDKObjc",
dependencies: [],
publicHeadersPath:"include"),//<----- This path is relative to the target! (and can be ignored)
]
)
2条答案
按热度按时间q8l4jmvw1#
我想明白了。我添加了一个模块Map来指定我的ObjC头,它工作了
不确定这是否是正确的方法,因为
include
文件夹应该已经自动执行此操作。i7uaboj42#
所以刚刚有同样的问题。(我的5美分)这是5月
Package.swift
:其结构为:
根据文档,publicHeadersPath应该是
publicHeadersPath:"include"
OR忽略(看起来它是相对于目标而不是根的)。我不认为我们应该为这样一个简单的结构触及module.modulemap