-
Notifications
You must be signed in to change notification settings - Fork 181
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
Rename, C API, minimum iOS target, and j make arg #18
Rename, C API, minimum iOS target, and j make arg #18
Conversation
- Renamed libnode.framework to Node.framework Apple framework naming conventions declare that framework names should start with a capital letter, and the `lib` prefix is reserved for static/dynamic libraries. - Moved the node::Start method to a node_start C method, allowing Swift compatibility Swift does not support C++ interop, and importing the libnode framework into an iOS Swift project causes a build error. To fix this, I've wrapped the node::Start method into an equivalent C method, and exposed that in a C header. - Set minimum iOS target to iOS 9.0 There is no reason to only target the latest version of iOS, as this library does not use new APIs introduced in iOS 11. I arbitrarily set the target to iOS 9, which is a typical minimum version that you'll find in apps that are backwards compatible. - Add -j8 to make arguments for iOS target Adding the `j` flag to make in the ios_framework_prepare script speeds up builds immensely on multi-core machines, by building in parallel, with a maximum of 8 concurrent build runners.
Thanks for the PR @IMcD23 . Regarding iOS 9, it should be noticed that the project only builds binaries for 64 bits, so Applications won't be able to use it if they're 32 bits. I'll take some more time to do some tests but I'd like to suggest some changes in the meanwhile:
|
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.
Hi, @IMcD23. Thanks for your contribution.
This PR can be merged after the requested changes:
- Changing the framework's name to
NodeMobile.framework
and the header file toNodeMobile.h
. This is to avoid confusion with Node's node.h. - Replacing
make -j8
formake -j $(getconf _NPROCESSORS_ONLN)
. That will make the number of threads adapt to the caller's CPU.
5d58b4e
to
6a973f5
Compare
Hi, @IMcD23, sorry for the delay. |
Landed in ec36bb6 |
Renamed libnode.framework to Node.framework
Apple framework naming conventions declare that framework names should start with a capital letter, and the
lib
prefix is reserved for static/dynamic libraries.Moved the node::Start method to a node_start C method, allowing Swift compatibility
Swift does not support C++ interop, and importing the libnode framework into an iOS Swift project causes a build error. To fix this, I've wrapped the node::Start method into an equivalent C method, and exposed that in a C header.
Set minimum iOS target to iOS 9.0
There is no reason to only target the latest version of iOS, as this library does not use new APIs introduced in iOS 11.
I arbitrarily set the target to iOS 9, which is a typical minimum version that you'll find in apps that are backwards compatible.
Add -j8 to make arguments for iOS target
Adding the
j
flag to make in the ios_framework_prepare script speeds up builds immensely on multi-core machines, by building in parallel, with a maximum of 8 concurrent build runners.Checklist
[x] Built iOS target using
./tools/ios_framework_prepare.sh
[x] Tested Node.js framework in a Swift application