-
Notifications
You must be signed in to change notification settings - Fork 23
Add CMake build #73
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 CMake build #73
Conversation
The `vm_page_size` variable declared in `mach/vm_page_size.h` is used when the header is available for inclusion. This header does not appear to be included anywhere directly resulting in build failures due to the missing `vm_page_size` declaration.
|
||
FetchContent_Declare(SwiftSystem | ||
GIT_REPOSITORY https://github.com/apple/swift-system.git | ||
GIT_TAG a34201439c74b53f0fd71ef11741af7e7caf01e1 # 1.4.2 |
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.
@shahmishal @owenv FYI since we're currently trying to get this to 1.5.0.
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.
Thanks!
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.
Thanks @etcwilde!!
Adding an initial CMake build for the Swift-subprocess library. At this time, it will build its own swift-system library, although we should allow it to search for one if one is available. CMake does not automatically generate modulemaps like SwiftPM does. As a result, we need to add one for Swift to import the C shims. There is one library target emitted from this build, Subprocess.
Adding steps to test that the CMake build works as expected.
Adding license header to the CMake files
Tell SwiftPM to ignore the CMake files to quiet the build warnings.
8989bec
to
8121674
Compare
Adding a CMake build so that projects that use CMake to bootstrap, like SwiftPM and swift-build, can use this library.
This is an initial pass. Future work should include a mechanism to use a pre-built Swift-System and an installation story that generates a
SwiftSubprocessConfig.cmake
file. Changes are necessary in the Swift-System CMake files in order to have a proper installation story here though because the SwiftSystem library is not properly exported.Unlike SwiftPM, CMake does not automatically generate modulemaps for C headers, so we need to include one.
I'm not sure how the
mach/vm_page_size.h
header was getting included, but I was getting errors about thevm_page_size
variable not being declared. If the header exists, include it so that variable is defined.Also added a workflow to verify that the CMake build continues to work.