-
Notifications
You must be signed in to change notification settings - Fork 470
Added build-android script which will build libdispatch for Android #302
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
Conversation
@milseman pls check this, thanks |
Are you aware of the cmake based build system? You should be able to build for android using CMake by doing:
|
Hi @compnerd have you tried it? Thanks |
@amraboelela I've not built it myself, but have worked with a number of others to build it. If there are issues with that, I'm happy to help resolve those. |
echoing @compnerd comment; we're hopefully just about to switch to CMake as the build system for libdispatch. So, android build should be based on that, not autotools. |
Agreed, please do not use autoconf for new work. Also, once we update the documentation (hint @compnerd) to explain how to hold CMake we should write the instructions here, I'd like to avoid having 10 different scripts for every single port. Instead the CMake build should do the right thing based on a single (or at most two) arguments. |
@MadCoder, yeah, thats the next change that I intend to make -- the docs! |
I ran: I got: -- Configuring done ~/swift/swift-corelibs-libdispatch$ git status
I couldn't find libdispatch.so |
You need to run the make command to actually build it. CMake generates the build rules. |
Ah ok, what about make install? Can I make it copy the libdispatch.so to the android toolchain, like what I did in the original script? |
So cmake is just a replacement of autoconf and configure? |
Now I got: |
Yeah, CMake is a replacement for autoconf/automake. I think you failed to specify |
Ok I am able to generate libdisptach.so file now inside the src directory. What about Dispatch.swiftmodule file, I need this one too. How can I generate it? |
You need to provide the path to the swift compiler |
So I am ending up giving back all the parameters i used to pass to configure before :) What about making it release instead of debug? Also I noticed that the generated lib dispatch.so file is 641KB while before it was 909KB, do u know why? |
Now I am using: make And I got: |
You know, its probably better off if you use |
But using the old fashion configure was working fine. Don't think build-script will help build lib dispatch for android, I tried it. My original build-android was based on: https://github.com/SwiftJava/swifty-robot-environment/blob/master/util/prepare_environment/060_build_corelibs_libdispatch.sh |
I added build-android-cmake if someone wanna try it |
@amraboelela I'm not using swift, as I'm only interested in libdispatch for pure C usage. As for your issue with Dispatch.swiftmodule, I'm pretty sure it can be done with CMake. Can you describe what's involved? Otherwise you can ask in the #cmake channel on freenode, the devs are really helpful. |
FYI, the last set of improvements for libdispatch's build should take care of the issues that you saw with |
Actually the latest “improvement” caused the swift/utils/android/build-toolchain to fail :), as it is no longer generate Dispatch.swiftmodule for linux, it used to do that before. |
As I mentioned, you will need to add the explicit flag to enable the swift part of the build :-). We most definitely generate that as it is done as part of the build for the swift SDK overlay :-). |
This is what the android/build-toolchain looks like: ${SWIFT_PATH}/swift/utils/build-script Can I add -DENABLE_SWIFT=YES to build-script parameters? |
Yeah, you could add that to the build script parameters as extra parameters. However, I think that is the core of the issue -- I never wired up the |
So will it look like this? ${SWIFT_PATH}/swift/utils/build-script Doesn't look right, as it is different from other parameters |
Another weird thing I noticed, when I run: ${SWIFT_PATH}/swift/utils/build-script I get: swift-android-toolchain$ find . -name "*.swiftmodule" Why does it put the full path ./home/amr/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix into the toolchain? |
I'm currently blocked by this issue, also because I need to build Foundation, which relies on Dispatch as well. Does anyone have a status update on this? @amraboelela? @compnerd the invocation in https://github.com/apple/swift-corelibs-libdispatch/blob/master/INSTALL.md only seems to build x86_64 libraries on my machine (Ubuntu 16.04) and an invocation of swift's
... doesn't seem to build dispatch for Android, only for the host system (unless I'm just looking in the wrong place? It's definitely not in I'd greatly appreciate any help or updates on this |
Yeah, the install doesn't place it under |
By cmake invocation, do you mean the dry-run output of |
@ephemer sure the dry run output should contain the CMake invocation. Did you pass CMAKE_SYSTEM_PROCESSOR? |
Okay, with #312 I was able to build a libdispatch.so for android. I didn't have the swift stdlib available for android, so I didn't test the swift integration. |
I tried build-android-cmake |
CMakeError.log contains: Determining if the VQ_VERYLOWDISK exist failed with the following output: Run Build Command:"/usr/bin/make" "cmTC_aefd8/fast" |
Run Build Command:"/usr/bin/make" "cmTC_ec569/fast" Determining if the function _pthread_workqueue_init exists failed with the following output: Run Build Command:"/usr/bin/make" "cmTC_2e36f/fast" Determining if the function mach_absolute_time exists failed with the following output: Run Build Command:"/usr/bin/make" "cmTC_6fc57/fast" |
This PR has gone stale. Please rebase and fix the conflicts before re-opening. |
Also has fix for https://bugs.swift.org/browse/SR-5885