Live data from Hacker News

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

github.com

71–80 of 190 posts

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

#72

Earlier quoted context omitted.

Cmake is a makefile generator. The output of cmake is a series of makefiles. That's it. If you need to build a project and you don't have make, nmake, jmake or whatevermake in your system them cmake does nothing to get your project built.

CMake can generate: * Borland Makefiles * MSYS Makefiles * MinGW Makefiles * NMake Makefiles * Unix Makefiles * Watcom WMake * Ninja * Visual Studio projects * Green Hills MULTI * Xcode projects And more: https://cmake.org/cmake/help/latest/manual/cmake-generators....

> CMake can generate:

Although you're conflating project transcoders with makefiles, nevertheless that's the whole point of cmake: generate makefiles that are used by some third-party program to actually build the software.

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

#73
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.

> just create a virtual environment

Yaw super lightweight ...

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

#74

Earlier quoted context omitted.

CMake is still a DSL for generating makefiles.

Yea, but what it's not is simple . Imho dealing with dependencies and making project build in one shot is hard in cmake. Maybe I did things wrong though.

> Yea, but what it's not is simple.

That really depends on what you're trying to do. Cmake's happy path for building an executable that depends only on libraries that already support cmake is very straight-forward.

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

#75
post #71

What rubs me the wrong way is that a lot of build systems have a fatal combination of unfamiliar syntax and complete lack of debuggability. Conan and Meson seem so much better in that regard.

Conan is orthogonal to the choice of build system, as in fact Conan's main choice of build system is cmake.

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

#77
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 then (with a standard Makefile and some supporting bash scripts) quite straightforward to mangle that graph into a list of translation units (namely those files whose name matches a depended-on header) which must be compiled and linked into the executable.

That is, I can simply create a new "executable file" .cpp file in bin/, include some headers therein and when I say make, the Makefile automagically figures out which (internal) dependencies it needs to link in when linking the executable.

Now that I have these "relatively straightforward" scripts and the corresponding Makefile, the incentive to move to another (nicer) build system which would require me to rebuild this infrastructure to fit into this other build system's view of the world is quite low – unless there is some way to do this directly?

Xmake as shown here (and also Meson linked in a sister comment) appear to still require manual selection of dependencies.

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

#78
Feels really interesting, too bad It has THE code of conduct. I don't support, distribute, endorse, use, and give any kind of publicity to projects using it.

inb4: "what's wrong with being decent/nice/inclusive?" it's not about that.

The CoC should be neutered with something like including protection for political views, or explicitly putting social media out of the project spaces.

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

#79

For better or worse though, CMake has won! Many IDE's including Visual Studio can directly work with CMake files. In addition, even Google which is famous for doing things their own way, has now added official, first-class CMake support to their open source C++ library Abseil https://abseil.io/blog/20190402-cmake-support If you are writing an open source C++ library, even if you support some other C++ build system, c…

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 you don't have to install more stuff just to __build__ some program you might not even want. I've run into more than one project that required a specific version of cmake, which as luck would have it, was not the version packaged with my distro. This leaves you either building another cmake first or finding a tool/library that isn't so persnickety.

Given the choice between trying a project that uses CMake or or autools, I'll choose the autotools based project every time.

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

#80
post #15

Now we have N+1 incompatibile build systems.

I think half those N's are cmake itself considering the amount of time I see "requires cmake x.x or above" messages. I wouldn't find having many build system such an issue if they'd just add a makefile (and maybe ./configure) to call that build system, giving devs a consistent interface and not having to lookup up how to do a simple build.

> if they'd just add a makefile (and maybe ./configure)

That's the whole point of cmake. Instead of running autotool's ./configure (which in fact is a whole dance involving autoconf, autoreconf, automake, and whatnot) just run cmake . to get yourself a fancy makefile.

Post reply on HN