5 ms·
Honestly, just use Cmake. It is far easier to make it work cross playform and better yet cross compile. There's no good reason to write a Makefile by hand and
by brian-armstrong 9y ago
Honestly, just use Cmake. It is far easier to make it work cross playform and better yet cross compile. There's no good reason to write a Makefile by hand and no large projects do it anyway
- chubot 9y agoHm you could argue the largest project did it that way... The Android platform used to be tens of thousands of GNU Make (including the GNU Make Standard Library). For 5+ years. I think they are migrating or have migrated to a custom system now. Also, the Linux kernel is pure GNU Make (no autotools, since that doesn't really make sense). But yes those are platforms/OSes and not applications. Applications typically work on multiple Unix flavors and Windows, so something like cmake makes sense. Although honestly it's a shame that they made the same mistake as GNU make -- not paying enough attention to the programming language design and ending up with a crappy macro language.
- cyphar 9y ago> Also, the Linux kernel is pure GNU Make (no autotools, since that doesn't really make sense). While that is true, they have a lot of wrappers and pseudo-meta-programming that makes it very simple to add a module to the kernel. It's unlike any other "pure GNU make" project I've seen.
- iainmerrick 9y agoThe Android platform used to be tens of thousands of GNU Make[files] Yes, and it was incredibly flaky and awkward to use! And slow. I think they are migrating or have migrated to a custom system now It used so many tricky macros that it already was a custom system, just one that happened to be built on top of Make.
- int_19h 9y agoCMake is rather crufty itself. There are many better options these days.
- benesch 9y agoI would love for this to be true, but I'm afraid I don't have any evidence that it is. What are the better options you'd recommend? More specifically, Google's Bazel [0] is the most serious attempt I know of to replace CMake/autotools, but it only just began to support Windows [1] and requires the JDK. Say what you will about CMake, but it's a quick-and-easy MSI to install on Windows and has supported Windows for probably longer than I've been alive. Google's other open source build system, GYP [1a], supports Windows because it builds Chromium, but GYP might as well be undocumented. Unless you like spelunking into the Chromium source, GYP is a non-starter. (Props to the Node folks for actually doing this for Node and Node extensions.) I haven't used Gradle [2], but I've heard more than a few times it's slow (warning: might be FUD)... and it also requires a JRE. Ninja [3] is blazing fast, but it's specifically designed not to be used directly, but rather through a build system generator like CMake. I'll be the first person to ditch CMake if a feasible alternative presents itself, but if you want to build a cross-platform, moderately-complicated C++ project today, especially one with dependencies on other libraries that use arbitrary build systems, I don't know of any such alternative. [0]: https://bazel.build https://bazel.build [0a]: https://gyp.gsrc.io https://gyp.gsrc.io [1]: https://docs.bazel.build/versions/master/windows.html https://docs.bazel.build/versions/master/windows.html [2]: https://gradle.org https://gradle.org [3]: https://ninja-build.org https://ninja-build.org
- bonzini 9y agoMeson (https://www.mesonbuild.com/ https://www.mesonbuild.com/) seems to have a lot of momentum; GNOME has just adopted it. It is designed around a non-Turing complete, object-oriented DSL, plus extension modules written in Python.