-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Get Core GL C++ Into Android Project #1753
Comments
This would be really awesome when it is available. Is this already working in your local repo? |
Yeah I look forward to having everything in Studio too. At one point in time (June last year) I did actually have everything built with a custom Let me know if you need help with this @bleege. First I would try getting NDK to compile all the C++ files. If we can get that to work then the hardest bit will be getting everything linked nicely. |
@ljbade Yeah, it'd be fantastic to get your 👀 on this.
Agreed. It's a little unclear to me how all the C++ and related dependencies would be compiled via NDK. I assume that Mason has to stay in the mix somewhere? Can you sketch out how you think this would work on a branch? |
Hmm yeah we going to need mason. Can't think off the top of my head the best way to do this. Perhaps we are going to need to create a series of custom Gradle tasks that somehow add dependencies and etc automatically from mason command calls into the NDK settings in the Gradle state. |
This is my thinking so far:
|
@kkaefer How hard would it be to get gyp to copy or symlink the C++ files in the Android target instead of compiling them? Is it also possible to capture the compile and linker flags set in gyp? Berhaps echoing them to stdout then gradle can grab them |
Can we get around copying the files into the jni dir by specifying the paths in a (generated) |
@kkaefer Yep. We can point the NDK at what ever path we want to. The only potential issue is if the debugger will work like this, but that's more of an unknown as Google hasn't even released it in Android Studio yet. In other words, lets worry about that later. My big blocker is just knowing what all needs to be compiled on the C++ side. If I can get pointed at the all the C++ needed I can then get the Gradle / NDK side wired up to start compiling things. |
Internal discussion between @kkaefer and @bleege about the pieces involved with C++ compilation for Android. |
According to this bug report Android generator is being removed from GYP. |
After experimenting with gyp's Makefile/android-%: CMD = deps/run_gyp android/mapboxgl-app.gyp $(CONFIG_android-$*) $(LIBS_android) --generator-output=./build/android-$* -f android
|
…orce deletion of directory when files exist in it.
Setting up the Copy C++ route. The After |
Reviewed Will now look at setting up the basic NDK build process. This will include:
|
Versions of Static Library dependencies are documented in |
@incanus Hopefully with Bitrise we can avoid the need to wrap |
@bleege I think we can close this now we selected Bitrise? |
@ljbade No. This is still need to address the need to have inline debugging of Java and C++. Please see the first sentence in this ticket:
|
Any update on this ? |
Bumping... Would It be possible to get at least working Android.mk and Application.mk files with all flags and dependecies needed to build? @ljbade You mentioned before that you successfully created Android.mk with all dependecies for older SDK version. Can you share it with us? |
@tomlocks We welcome PRs on enabling this functionality. The difficulty has always been trying to integrate the common C++ code that doesn't live directly in the Android project filesystem as it's reused by iOS, OSX, Qt, and others. |
@bleege How can I import |
@zhangzhuowh The oiginal work on this was focused on copying the C++ source code into the Android Studio |
⇢ #5855 |
In order to support C++ / NDK debugging in Android Studio and streamline CI builds and artifact publication we need to refactor the current
make android
process to integrate the Core GL C++ project files into the Gradle managed Android project. The current process compiles the Core GL into.so
files based on ABI and places them intojniLibs
for the Gradle build process to then use as a separate step, while the new process will copy the uncompiled C++ files intojni
and make (the Gradle driven) Android NDK responsible for compiling them and linking them via JNI to the Android code along with building the SDK as whole in one step. This process will essentially mirror what is done for iOS and Xcode withmake iproj
where Xcode is responsible for all the compilation and linking.Unknowns
Android.mk
files be needed or will the built in NDK controls in Gradle be enough.Resources
@mapbox/mobile @mapbox/gl
The text was updated successfully, but these errors were encountered: