Skip to content
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

Difference with builtin cmake support? #6

Open
mcclure opened this issue Sep 17, 2018 · 6 comments
Open

Difference with builtin cmake support? #6

mcclure opened this issue Sep 17, 2018 · 6 comments

Comments

@mcclure
Copy link

mcclure commented Sep 17, 2018

This looks neat! One thing I wish was clear in the README doc however: Recently cmake support was added to gradle. How does using this plugin differ from gradle's inbuilt cmake support?

For example, does this plugin make it possible to use ndkbuild and cmake in the same app (this is not possible with gradle's inbuilt support)?

@paleozogt
Copy link

@mcclure Do you mean the CMake integration for Android NDK? I don't Gradle proper has CMake integration, tho I'm happy to be proven wrong.

@awrichar
Copy link
Owner

Yes, I do think they recently added cmake and autotools support. Samples from the Gradle project:
https://github.com/gradle/native-samples/tree/master/cpp/cmake-library
https://github.com/gradle/native-samples/tree/master/cpp/autotools-library

I can't say in detail how my plugin differs from the new support, since I haven't had a chance to play with it yet. I started this plugin a few years ago when there were no signs of getting this functionality in Gradle core. Fast-forward to 2018 and they now have some portions of it, so I imagine this plugin may eventually be superseded by the core support. The main differences off the top of my head are related to legacy support and more user-exposed customization, ie:

  • Support back to at least Gradle 3.5
  • Integration with the Rule-Based configuration model
  • Support for qmake and other custom build tools

If you find other notable differences, please share!

@paleozogt
Copy link

@awrichar Wow that's great. Are there any docs around this? Or does it only live in the samples?

@awrichar
Copy link
Owner

@paleozogt It seems like the docs are still catching up. I remember seeing this blog post, but I can't even pinpoint the release where they added the new C++ plugins and essentially moved away from the rule-based model. I think it was early in the 4.x chain. Despite that, the official docs for native still seem to be focused on the rule-based model.

@paleozogt
Copy link

@awrichar Looking more closely at these examples, there isn't in fact a CMake plugin for gradle.

The examples project includes source for a toy CMake plugin as an example of how one might integrate CMake into a project. But its not distributed as a plugin jar-- one would have to copy it into one's own project or build and publish it manually.

I'm not clear on what this means for Gradle-- is this intended as beta source for a future CMake plugin? Or is it just meant to illustrate tool usage and nothing more?

@mcclure
Copy link
Author

mcclure commented Sep 20, 2018

Hello,

The way I do this is I have the following in my build.gradle:

android {
      // [[ BUNCH OF STUFF SNIPPED HERE ]]
	externalNativeBuild {
		cmake {
			path "lovr/CMakeLists.txt"
		}
	}
}

Looking, it appears it is as @paleozogt said, there is no official cmake plugin for gradle, rather, the Android plugin has cmake support. I did not realize this when I posted earlier :) Google's documentation is all very unclear around this feature, which is why I was recommending your utility could clarify in its own documentation to avoid any confusion. However if all you'd be doing is explaining a difference between your plugin and the Android plugin I'm not sure this is so necessary…!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants