-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SwiftPM support #515
Add SwiftPM support #515
Conversation
添加了 SwiftPM 支持,大佬能抽空帮忙看下吗? @Richard-Cao 合入后可能还得发布一个新版本才行 |
@wsxyeah 一起看看 |
这几个头文件是用的软链接?GitHub diff 上看不太出来 |
是的,不太想破坏原目录结构,常见的做法是把对应 header 软链到 include 里来满足 Package 要求的 Layout
|
配置 |
publicHeadersPath 不传就是默认 "include",用 "." 试过是不行的,因为布局不满足要求 |
Nope. Sorry for the miswording/confustion I cause. You can have a look at the SwiftPM repo code here // Compute the path to public headers directory.
let publicHeaderComponent = manifestTarget.publicHeadersPath ?? ClangTarget.defaultPublicHeadersComponent
public final class ClangTarget: Target {
/// The default public include directory component.
public static let defaultPublicHeadersComponent = "include"
publicHeadersPath will be "include" if we do not specific it for ClangTarget. We still need such layout here. If you do not provide include folder and try set it to "." things will not work here because the layout is not valid.
If you like, I can add Again, if you have any better suggestion or comment, I believe the best way is to communicate via code/patch. |
试了下这样写是可以的 @@ -38,12 +38,14 @@ let package = Package(
name: "CLogan",
dependencies: ["mbedtls"],
path: "Logan/Clogan",
- exclude: ["main.c"]
+ exclude: ["main.c"],
+ publicHeadersPath: "./"
),
.target(
name: "Logan",
dependencies: ["CLogan"],
- path: "Logan/iOS"
+ path: "Logan/iOS",
+ publicHeadersPath: "./"
),
]
) 另外 |
Co-authored-by: wsxyeah <[email protected]>
Thanks, it works. Maybe there is some strange cache issue for my previous try.
Done |
@wsxyeah 那我合了? |
ok |
合了,应该要重新发个版 |
cc @wsxyeah |
Done |
No description provided.