-
Notifications
You must be signed in to change notification settings - Fork 26
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
Remove CMake from the build process #227
Conversation
0f64bef
to
36ea5d6
Compare
36ea5d6
to
b6f1d04
Compare
54744ad
to
345e91d
Compare
I've got this working with both Meta Quest and HTC Vive XR Elite now. I ended up having to include the Khronos loader .so files in the repo because the package from gradle is setup to be a "prefab" to use when building with CMake, and I couldn't get gradle to just pull in the .so files. Personally, I think this is fine - we're including the .so's for all the other loaders already, so this is no different. Unfortunately, that's all the headsets I have to test! It'd be great if other folks could test the builds on other headsets too, but there isn't any more that I can do personally. I've also added a non-functional Anyway, I'm taking this out of draft now :-) PS: Look at how fast the fully cached builds are! The Android build finishes in ~2 minutes, compared to ~20 minutes before this PR. |
345e91d
to
22cdb79
Compare
Regarding the Khronos loader...
I am confused how Gradle could pull them if they are in I'm happy to put them also in e.g.
|
If the files were in jniLibs, then you should be able to do this to pull in the .so files:
I suppose we could do something like that here too, and manually unzip the .aar file to get the files...
I think within the AAR file, they should actually be under |
I mean, that's approx the experience that you get when using prefab with cmake or android.mk. I didn't think it worked without turning on prefab. does this aar work? (just renamed to zip to be able to upload) It's 1.1.43 with the patches from me to also populate jniLibs (which does look like the right dirs per android codesearch) |
OK, guess that's my bad... it does appear that |
22cdb79
to
28f8924
Compare
@rpavlik Thanks! Unfortunately, I wasn't able to make it work. When using a local AAR file, I got errors like:
It's possible that it could work with a non-local AAR from Maven, or maybe configuring it in a different way (I also tried using a flat file repository, which also didn't work, but maybe I'm missing some magic incantation). Anyway, I ended up changing the PR to manually extract the AAR and copy the .so files, rather than depending on Gradle's built-in dependency handling (similar to the |
37f3bab
to
5295889
Compare
5bce260
to
7373963
Compare
I think have all review addressed now, and CI doesn't fail, however, the artifacts don't look quite right and I need to figure that before this is ready. For some reason, in the artifact built on CI, all the AARs have the Khronos loader. Locally, this doesn't happen, I can unzip the AARs and see the correct loader in there. So, I need to figure out what's going on with that. Also, the binaries are way smaller, like 10% of their previous size. For example, the Khronos AAR goes from 28mb to 2.2mb. The prefab stuff isn't there any more, but the biggest difference is just from the |
5943f45
to
92f4913
Compare
Alright, I think this is ready now! Removing the Gradle caching from CI fixed the problem with all the AARs including the Khronos loader. I unzipped and inspected them all, and they all have the correct loader in the artifact from CI. I don't think the Gradle caching really did much for us anyway. With the caching disabled, the job that runs gradle completed in ~1 minute, so that seems fine. Regarding the size: I think the cmake builds were so big because they couldn't use the I also tested the binaries in the artifact from CI with:
They all worked fine! Unfortunately, that's only testing two loaders: the Meta one and the Khronos one. But I don't have any hardware that uses any of the other loaders. |
025f7b7
to
e2facb9
Compare
I've just rebased this on latest That PR fixes a compile time regression in godot-cpp, and since one of the major advantages of this PR is to improve build times, I think it makes sense to pull it in here as well. |
19a721e
to
f61af33
Compare
48dff97
to
73e7b62
Compare
@m4gr3d Thanks for the review! I've addressed both points in my latest push |
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.
Looks great and works as expected! Awesome job!
Presently, we're using CMake to build the GDExtension (aka the C++ bits) on Android, but using scons to build for every other platform.
This causes a couple of problems:
#define
s to exist, because I know godot-cpp adds them, only to realize they weren't there when doing Android builds because they weren't in our custom CMake configuration hereThis PR switches to always using scons to build everything C++-related, and then Gradle just pulls those
.so
's into the.aar
files. This is similar to how Godot is built for Android.This has some follow on effects:
META_VENDOR_ENABLED
,PICO_VENDOR_ENABLED
, etc. We never ended up using those defines for anything, though. This will just save us build time :-)libopenxr_loader.so
to ourlibgodotopenxrvendors.so
. We never really needed to do this - we just need to make sure thatlibopenxr_loader.so
gets loaded early enough. This PR switches to loading it explicitly in the Android plugin, which is working in my testing. (Note: thelibopenxr_loader.so
may be a different actual loader depending on the vendor, but it always has that same file name.)abiFilters
doesn't seem to work for excluding certain architectures in different flavors. So, I had shuffle around the directories for those binaries, so I could instead usejniLibs.srcDirs
to point at the architectures we want. I also just removed thearmeabi-v7a
binaries for the Meta loader, because I think that's for like GearVR or Oculus Go or some other unsupported platform.TODO:
Add a non-functional CMake configuration that can be used to configure Android Studio for debugging. We do this same thing for Godot.Test the plugin with other vendors and make sure it's still working! I've tested builds from this PR on Meta Quest, and it works great. :-) I need to test on the HTC Vive XR Elite, and ensure it still works there.But that's the only other Android headset I have - it'd be great to get some help with testing this from other folks with other headsets.Marking as a DRAFT until those TODO's are completed.UPDATE: I've tested with both Meta and HTC Vive XR Elite (which uses the Khronos loader), and it's now working on both of those. It'd be great if folks who have Pico, MagicLeap, Lynx, etc were able to test too, but I've done as much as I can personally.