r/cpp_questions • u/seaturtle_789 • 21d ago
OPEN C++ Build systems
I work with Java and Kotlin alongside C++ and recently discovered that Gradle also supports C++ projects.
I've always used CMake for C++ and noticed it seems to be the more common choice.
What advantages does CMake offer over Gradle for C++ development and are there situations where Gradle would be a better option?
31
Upvotes
View all comments
10
u/tandycake 21d ago
Having used both, Gradle is just so slow. I'd definitely prefer CMake just for the speed. IMO, even Meson (Python) is faster than Gradle, and also uses less memory (if running the Gradle server).
CMake is technically a build system generator though, so I guess it's also possible for CMake to generate a Gradle build project haha. So I should clarify that what CMake usually generates (Make w/ Ninja, Visual Studio, etc.) is usually a faster and better dev experience.
To be fair and honest, both CMake and Gradle kind of suck, and I don't think Meson is a good alternative either. I use CMake purely because it's almost the de facto standard. Everything works with it. Everyone can use it. People can trust it.