Live data from Hacker News

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

github.com

31–40 of 190 posts

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

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

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.

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

#33
post #12

Earlier quoted context omitted.

"CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice." They would disagree with you.

no, they won't "generate native makefiles" (I prefer Ninja myself) - this is what used to build software

Leveraging compositional abstraction doesn't change what you use the thing for. I use cmake (well I don't often, but when I do) to build my projects. How it accomplishes that is if little concern.

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

#34
post #31
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

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.

You can try xmake's dependency package management.

    add_requires("libuv master", "ffmpeg", "zlib 1.20.*")
    add_requires("tbox >1.6.1", {optional = true, debug = true})
    target("test")
        set_kind("shared")
        add_files("src/*.c")
        add_packages("libuv", "ffmpeg", "tbox", "zlib")

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

#35

Does it have any distributed build or caching support? That is my minimum bar for a C++ build system. ccache and distcc/icecc are too limited, you want something integrated with your build system directly.

Distributed builds are being planned, but not yet implemented. You can see https://github.com/xmake-io/xmake/issues/274

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

#36

Earlier quoted context omitted.

Hermetic Builds. ... Our builds are hermetic, meaning that they are insensitive to the libraries and other software installed on the build machine. Instead, builds depend on known versions of build tools, such as compilers, and dependencies, such as libraries. Kind of like a container for building? I had to look it up myself.

How would it do that besides building in a container?

Look into bazel, pants, and similar hermetic build systems.

You pin all dependencies and manage flags and such but via the build system.

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

#37
post #24

Earlier quoted context omitted.

Python is preinstalled on any major Linux distro. Ninja is tiny, so those don't seem that heavyweight.

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

Any new project will very, very likely be using Python3. It appears like that applies to meson. `python3` is the expected binary (`python` is still expected to point to Python 2 for the foreseeable future and `python2` being the explicit binary--some distros have jumped the gun on `python`). Similarly, they have completely different accompanies executables (pip3, wheel3, pydoc3) and completely separate library paths. What sort of compatibility issues have you seen?

The requirements say Python 3.5 or newer. That was released in 2015. Outside of major versions, Python has generally been forwards compatible (especially if you're testing). After more than a decade of use, the only grumbles with supporting old Python version is not getting to use new features (or working around fixed bugs).

I say this as someone who still uses Python 2 every day.

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

#39
post #17
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

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.

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

#40

Earlier quoted context omitted.

Hermetic Builds. ... Our builds are hermetic, meaning that they are insensitive to the libraries and other software installed on the build machine. Instead, builds depend on known versions of build tools, such as compilers, and dependencies, such as libraries. Kind of like a container for building? I had to look it up myself.

How would it do that besides building in a container?

I don't know if this is what the parent was intending (I'm curious to see other examples), but depending on your definition Nix (nixos.org) seems to fit that need.
Post reply on HN