Live data from Hacker News

Show HN: Xmake, a modern C/C++ build utility

github.com

131–140 of 190 posts

Re: Show HN: Xmake, a modern C/C++ build utility

#132
post #14

Meson[0] has been gaining in popularity and has migration tools for cmake projects. Large projects such as systemd and gnome[1] have migrated or have been migrating for years [0] https://mesonbuild.com/ [1] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting

Why migrate from CMake to meson?

Nobody who has used CMake would ask that so I assume you haven't!

The answer is that CMake is mad and full of gotchas. Think of it like the PHP of build systems. Here is a classic example:

https://cmake.org/cmake/help/latest/command/if.html#variable...

Re: Show HN: Xmake, a modern C/C++ build utility

#133
post #14

Meson[0] has been gaining in popularity and has migration tools for cmake projects. Large projects such as systemd and gnome[1] have migrated or have been migrating for years [0] https://mesonbuild.com/ [1] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting

what about Bazel ? https://bazel.build/

Bazel is very slow and heavy and only Google uses it.

Re: Show HN: Xmake, a modern C/C++ build utility

#134
post #126

Im not a fan of LUA. The syntax of XMake.lua reads somewhat like CMake but easier to understand. What I'd really like to see is a build system in Python (3!) utilizing objects and dictionaries for tasks like this should be a breeze.

Do you consider waf to meet that criteria? https://gitlab.com/ita1024/waf https://waf.io Or scons? https://scons.org

I'll check it out, thanks.

Re: Show HN: Xmake, a modern C/C++ build utility

#135
post #126

Im not a fan of LUA. The syntax of XMake.lua reads somewhat like CMake but easier to understand. What I'd really like to see is a build system in Python (3!) utilizing objects and dictionaries for tasks like this should be a breeze.

Just out of curiosity, what parts of lua do you not care for?

Probably just bad experiences with it in the past and the lacking IDEs. e.g. PyCharm makes writing Python a breeze.

Re: Show HN: Xmake, a modern C/C++ build utility

#137
post #124

Earlier quoted context omitted.

if cmake was any good, the makefiles it produces would be portable, and distributing the cmake program itself would be unnecessary

CMake is doing more than generating a build file, it's also a configuration tool (detecting compiler, finding dependencies, etc).

The dependences do not change upon distribution, so they can be safely encoded on the makefile. As for "detecting" the compiler, either it is in the path, or in the CC variable (or analogous), in which case the makefile can work; I do not honestly understand what is the task of cmake here. The only use that I can see is creating projects for other build-systems, e.g. for windows. But if you only distribute your code to posix systems, and your project is small(ish), then cmake does not really add anything.

Re: Show HN: Xmake, a modern C/C++ build utility

#138

Earlier quoted context omitted.

Why migrate from CMake to meson?

Oh, the number of hours of my life I spent debugging CMake files of third party libraries. You are very fortunate if you import libraries that just work. This is also true for "modern" CMake.

Bad code is an unfortunate fact of life. How does that go away. This could be either easier debugging, some enforcement of clean code (how is that possible), the tool is limited so you can't do complex things, or just so far only good coders have been involved not the masses of bad coders. My default assumption is the last, but I'm willing to be proven wrong.

Re: Show HN: Xmake, a modern C/C++ build utility

#139

Earlier quoted context omitted.

> An underappreciated bonus is that you don't have to install more stuff just to __build__ some program you might not even want. sorry what ? I remember hours in my younger years searching which Debian package provided autowhateverflavoroftheday.sh so that I could build $random internet project

> > An underappreciated bonus is that you don't have to install more stuff just to __build__ some program you might not even want. > sorry what ? I remember hours in my younger years searching which Debian package provided autowhateverflavoroftheday.sh so that I could build $random internet project The whole point of Autotools is that distributed source packages can be built by themselves, without requiring any part…

> That said, I know what you mean. I've had to seek out a number of different versions of Autotools just to get some things to build. But that is because a lot of projects and/or distro packaging blatantly uses Autotools differently than it's was designed to be used. I don't think Autotools should be blamed for this.

yes, it absolutely should be. If a tool is misused, it's generally because it's hard to use correctly. In contrast, if I see a repo with a CMakeLists.txt I know that it's going to be a simple cmake && make.

Re: Show HN: Xmake, a modern C/C++ build utility

#140

Earlier quoted context omitted.

A better question is does it need to have tooling or IDE support to be worked with? It's good to have tooling and IDEs for CMake because CMake is complicated and hand-editing the files is very tedious. But if Meson eliminates the tedium of CMake by providing you with different abstractions then you don't actually need the IDEs or tooling.

> A better question is does it need to have tooling or IDE support to be worked with? No, that's the wrong question and one that's only purpose is to deflect attention from its shortcomings. All build tools need tooling because if they are adequately integrated into development workflows they are transparent and easy to use. Cmake meets that requirement, and until other alternative build systems do then they will alw…

cmake has the best integration of any third party build tool, but if you can lock yourself to one IDE the ability to click "new file" and have the file created, added to version control, and the build system all in one easy step is powerful.
Post reply on HN