KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.36k stars 649 forks source link

Update android build setup #1188

Open SaschaWillems opened 1 month ago

SaschaWillems commented 1 month ago

We need to update our android build setup and make sure it works with recent Android build tools and IDEs. Some recent issues suggest that this is no longer the case and people can't build our samples for Android.

I'll take a look at that.

SaschaWillems commented 1 month ago

This won't be easy. Upgrading to recent Android build tools shows a lot of problems and errors. We need to do this more regularly.

One example: Our version of spdlog is broken with recent compilers, but to update that, fmt submodule also needs to be updated. But then spdlog no longer compiles because they won't work together. See https://github.com/gabime/spdlog/issues/3202, so until they fix this we can't really update :(

Another problem: We use .in files to generate build files for Android. So if you run upgrade assistants from Android Studio, those changes are applied to the non-versioned generated files, which in turn means you have to manually apply those to the .in files. That's very cumbersome and error-prone and something we should rethink. I don't see any benefit in doing what we do right now.

gpx1000 commented 1 month ago

Would you like some help? I'm happy to take a look.

SaschaWillems commented 1 month ago

Thx :) Currently assessing what required fixing. If I get stuck I'll reach out for help.

pratikpc commented 1 month ago

@SaschaWillems spdlog doesn't build with the latest upstream branch yes, but given that you are using submodules, you could connect your fmt submodule to v11.2 tag / 0c9fce2ffefecfdce794e1859584e25877b7b592 commit which is the latest release.

spdlog should build with it.

So my recommendation would be:-

  1. Spdlog latest commit or tag
  2. FmtLib at v11.2 tag as spdlog would support it.
    The negative of course is that the fmt version in use at Vulkan Samples would not be upstream but that shouldn't be an issue though right?

If y'all need any help with this, am open. I have zero idea about how Vulkan works or for that matter how Android builds but this seems very interesting to me.

SaschaWillems commented 1 month ago

Thank you very much. That's very useful, updating the fmt submodule to that tag is totally fine and not problematic in anyway. With that combination, spdlog latest and fmt with tag 11.0.2 building on Android works now 👍🏻

Now on to the remaining issues with our build setup...