Live data from Hacker News

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

github.com

91–100 of 190 posts

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

#91

Earlier quoted context omitted.

Why migrate from CMake to meson?

CMake feels a lot like C++89: Lots of things you can do, but there are problems: * No standardization or opinionated design, so you can't share your work easily. * No sane defaults, so your build system is always fragile, difficult to maintain, and done wrong. * No best practices, so people keep making the same mistakes over and over. * Misguided attempt to remain compatible with the steaming pile of legacy they've a…

1 and 3 are not true anymore, the new canonical CMake way is targets with attached dependencies, header file search paths, compiler flags and possibly other things. Bad documentation - well yeah, it's specifically missing first-party best practices and howto documentation and the third-party documentation as well as really old first-party documentation in the CMake wiki often recommends bad old practices.

You forgot to mention that the language is awful (but that usually doesn't get in the way IME).

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

#93
post #24

Earlier quoted context omitted.

Python also has version compatibility issues, such as: python2.x, 3.x. Also need the user to install the specified version of python

> Python also has version compatibility issues, such as: python2.x, 3.x. If that really bothers you then just create a virtual environment and locally deploy whatever version you want to run. That issue ceased to be a concern years ago.

    export PIP_REQUIRE_VIRTUALENV=true
It's the only sane way to use Python.

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

#94

What I miss about these tools is some "relatively" straightforward dependency detection and generation. That is, I have a bunch of .cpp files which need to be compiled into individual executables in a folder bin/. I also have a folder inc/ which contains some headers (.h) and those headers possibly also have some associated TU (.cpp). Now g++ can already generate a dependency graph of headers for an executable. It is…

Your workflow is one way to build and link, but not the only way. I might want to build several of those TUs into a static library, link against it, and ship it alongside a few executables.

And when it comes to creating a library, it's difficult to infer which TUs should be pulled in or left out since you'd need to see at least representative samples of the use of that library to be able to infer that.

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

#95
post #31

Earlier quoted context omitted.

Meson looks nice, but it still lacks a way to tell it where your dependencies are installed(like cmake’s CMAKE_PREFIX_PATH). You can try to get by, by setting pkg config path, but it doesn’t help for dependencies that don’t support pkgconfig.

> a way to tell it where your dependencies are installed(like cmake’s CMAKE_PREFIX_PATH). That's not how dependencies are discovered in cmake. Dependencies are added with calls to find_package, and if you have to include dependencies that don't install their cmake or even pkconfig module then you add your own Find .cmake file to the project to search for it, set targets, and perform sanity checks.

That's not entirely true, CMAKE_PREFIX_PATH is used in find_package and find_library calls.

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

#96

Earlier quoted context omitted.

Cmake has tooling and is supported by IDEs. Does Meson have anything comparable?

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?

C++ really benefits from it. ctrl+click on a symbol is much more sane than (re)teaching Argument Dependent Lookup rules to all of the engineers in your organization.

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

#97

What I miss about these tools is some "relatively" straightforward dependency detection and generation. That is, I have a bunch of .cpp files which need to be compiled into individual executables in a folder bin/. I also have a folder inc/ which contains some headers (.h) and those headers possibly also have some associated TU (.cpp). Now g++ can already generate a dependency graph of headers for an executable. It is…

How would a tool know from a header dependency, in which source file the implementation for the header lives? C or C++ don't require any relationship between a declaration file and implementation file. The implementation could be in an entirely differently named source file, or spread over various files, mixed with implementation code from other headers, or included right in the header.

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

#98
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

AFAIK Meson requires a python installation, which is a non-trivial dependency and on some platforms requires additional manual setup steps.

Having everything in a single standalone executable is vastly preferable IMHO.

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

#99

Earlier quoted context omitted.

Cmake won against the incumbent, which was autotools. Still it's still far from being an enjoyable tool, whose experience is made even worse by its god-awful docs.

Personally, I vastly prefer autotools, both as a user and developer. When I got to the point I needed some kind of build system, I found autotools much easier to learn than cmake. As user, I find the experience with autotools to be much nicer as well. For whatever reason, the interface just seems more intuitive. I mean, ./configure --help will tell you basically all you need to know. An underappreciated bonus is that…

> 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

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

#100
post #17

Earlier quoted context omitted.

But the meson installation has many dependencies, it is not very lightweight, it needs python, ninja, and xmake has built-in luajit, no third-party dependencies, more lightweight

I can't think of a context in which I've used Meson where it ever felt not lightweight. Python is already installed in every system and ninja is quite small.

Python isn't installed on Windows, the pre-installed python version on macOS is stuck at 2.7.10.

ninja isn't installed on macOS and Windows, and both systems require to first install a package manager before installing ninja, or compile ninja from scratch.

Post reply on HN