Live data from Hacker News

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

github.com

41–50 of 190 posts

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

#41
post #38

mmh. cflags and cxxflags are command line options ? i would expect them to be defined as part of build file.

You can also define them in build file (xmake.lua)

    target("test")
        set_kind("binary")
        add_files("src/*.c", "src/*.cpp")
        add_cflags("-fPIC", "-Dxxx")
        add_cxxflags("-fPIC", "-Dxxx")
 
The command line arguments just give you a quick and easy way to modify cflags.

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

#43
post #16

Don’t ever install software by piping arbitrary remote scripts into bash.

Assuming the script is hosted on an https site, is a popular tool (like brew or rustup) from a trusted source, why would this be any more dangerous than downloading and installing from a a package manager? What would it take beyond https and a well-known site to make you comfortable doing this?

> why would this be any more dangerous than downloading and installing from a a package manager?

Normally the packager and developer are different people so there is a second set of eyes to at least give a cursory glance to the changes. It takes more than a single compromised account to publish malicious changes. There are of course a million exceptions and caveats to this and it's not perfect, but it's better than allowing developers to push code directly.

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

#44
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?

In my experience the primary reason people migrate is that it is significantly simpler for ordinary developers to maintain and configure builds in Meson. They both target ninja but the learning curve for CMake is definitely steeper.

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

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

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

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

#46

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…

Now we just need a better DSL that can generate Cmake files.

And CMake itself started as a simple DSL for generating Makefiles. We've gone full circle

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

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

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

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

#48

Earlier quoted context omitted.

Why migrate from CMake to meson?

In my experience the primary reason people migrate is that it is significantly simpler for ordinary developers to maintain and configure builds in Meson. They both target ninja but the learning curve for CMake is definitely steeper.

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

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

#50

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.
Post reply on HN