-
Notifications
You must be signed in to change notification settings - Fork 109
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
swift: Config for Swift Package build #2420
Conversation
22bbf9d
to
4b5eeb2
Compare
@hermet @tinyjin I've now marked this PR as ready to review as @tinyjin and I have been collaborating on the Swift API as you can see here. And we're getting close to merging that PR! 🎉 For this PR, these are the minimal requirements to get the Swift Package building. As mentioned, where I've added the symbolic link and the config file may not be the best place to put them so would love your feedback as code owners of this repo 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andyf-canva Thanks! Quick comment here. I think ThorVG doesn't need changes for this. The best approach would be to generate the config.h
during the build & packaging thorvg swift with the latest throvg release. Or, at the very least, this change should be included thorvg.swift
side.
@hermet thanks for the feedback ❤️ That's a fair call. From memory, I wasn't able to perform a sort of "build step" from the SPM side, but let me take a look again. Because I agree, seems like something that should just happen at build time. Will report back soon. 👍 |
Good news - I've removed the symbolic link because we can point the Swift Package path to a layer higher to include the Last thing to figure out: the |
An update: I've removed the |
That means that this PR is now not making any changes on the |
Recently we have opened a new ThorVG for Swift repo: thorvg.swift.
Code will be migrated from a Swift fork thorvg-swift. You can see more details here at the GitHub issue on the repo.
In order to build the Swift Package, with the thorvg core as a submodule inside the thorvg.swift repo, the following changes need to take place for the upstream thorvg repo. These are what are currently allowing the thorvg-swift repo to build.
Config header file
When building the thorvg source using the
meson
build system, we spit out a config.h inside the outputbuilddir/
directory. Many of the C++ source files refer to this at compile time.Swift Package Manager doesn't follow the same paradigm, and requires all files to be present in the target directory at compile time. Thus, we need to generate a
config.h
file ahead of time so that SPM can see that header file and successfully build all of the C++ source files.For time being, I've put this underneath the C API bindings folder, but am open to another destination for this file.