r/cpp • u/dotano661 • Dec 24 '24
xmake is my new go-to build tool!
I ported one of my projects from cmake to xmake today and it has gone so smoothly... I don't understand why xmake doesn't get the love it deserves. Going to port the rest of my projects. :-)
I don't post much but I felt like I should share my experience. Cheers!
88
Upvotes
2
u/IAmTsunami Dec 24 '24
Have you tried cargo?🙃
67
u/LordKlevin Dec 24 '24
I've used xmake a few times for personal projects and really enjoyed it, but I must admit I didn't even consider it when our company was recently switching away from qmake.
The reasons were:
Cmake is supported everywhere. I needed to make sure it worked with Visual Studio, VS code, QtCreator and CLion as the bare minimum.
Qt has hidden a lot of the ugly parts of their compilation inside CMake.
For legal reasons we have to bundle our own dependencies, so I needed it to work with just a folder full of cmake projects.
No one was ever fired for choosing Cmake.
Maybe Qt support in xmake is actually great and I just didn't know. Maybe getting xmake and QtCreator to play nice is really easy. I just didn't find the resources for it.
I really do hope xmake becomes more widely supported. For vanilla c++ projects it is really really easy to use.
7
u/Stagram_ Dec 24 '24
Same here, I don't understand why people keeps going with such an unfriendly tool when xmake exist and is fantastic. I guess we need to spread the joy it procures when you setup a project in 2 seconds and build it as fast
38
u/SirLynix Dec 24 '24
I've been using xmake for a lot of projects now, it's really great, and continuously improving.
The main criticism I heard against it is that the author is chinese, but this is an open source tool with a lot of contributors from other countries as well. I think I'm near a hundred merged pull request (I'm belgian if that matters) and quite familiar with the source code, there's nothing suspicious.
By the way, Microsoft and Epic Games used xmake for some projects, there's even a Unreal server tool built with it (search xmake in Unreal Engine changelog), if that eases your mind.
This is truly one of the best tool a C++ developer could dream of, it's a bit sad to judge it only by its author country. Also, one of its strength is its ability to use the existing ecosystem, switching to xmake doesn't mean you have to give up or rewrite your cmakelists. You can even use xmake-built dependencies in a cmake project (xrepo-cmake).
14
u/GregTheMadMonk Dec 24 '24
The big question is: how does it integrate with an existing CMake infrastructure? Does it know how to build a dependency that uses CMake? Does it know what targets this dependency would export?
17
u/[deleted] Dec 24 '24
Been using xmake for a couple of years now, easily the absolute best experience I've ever had with a C or C++ build system. Nothing comes close.
Even not C or C++, I can write rules for ANYTHING
10
u/Adorable_Interview81 Dec 24 '24
I tried xmake but gave up -- it worked very well and friendly at the start, but it did not work when you need to change something, like even the natural per directory layout was not supported.
10
u/James20k P2005R0 Dec 24 '24
I started off thinking xmake was great, but have come to strongly dislike it. Its rare that a piece of software makes me genuinely annoyed at it, because I like to think I'm very patient in general
I've had so many issues with it, even for pretty basic stuff. I only use it for the absolute simplest projects now. Its either makefiles or cmake for me. Its a nice idea, but it needs another few years in the oven, at a very high temperature until its incinerated preferably
13
u/dexter2011412 Dec 24 '24 edited Dec 24 '24
I've been trying to move away from cmake but it has so much industry penetration. It's so cumbersome. It's nice when it works but it doesn't have to be so weird. The number of "oh you want this you have to do it like this" tribal knowledge is just too much. The documentation is getting better but it's still feels like this weird hybrid of a scripting + hidden-global-state + command-based language.
Oh lol downvotes galore. Oh well
3
u/xiaozhuzhu1337 Dec 27 '24
The goal of xmake is not to replace cmake, but to reuse its ecology
7
u/Motor_Log1453 -static Dec 24 '24 edited Dec 24 '24
xmake needed to be appreciated more and it's not about xmake vs. others. xmake works... along with xrepo it's a smooth experience to work with other libraries. One more thing I like about it is its 'watch' subcommand, a file watcher that detects changes and rebuild the project (or run any arbitrary set of commands). Really convenient if you work on a small project to try things out. I like xmake. Edit: wording
2
u/whizzwr Dec 24 '24 edited Dec 24 '24
<insert build tool other than cmake> are usually fine for personal and smallish project.
Once you need real dependencies for commercial deployment with different platforms than your standard Linux distro install, then you realized, "lol no I'm not paid high enough to port and MAINTAIN these cmake shit to <insert build tool other than cmake>".
For personal project I like meson, I should try xmake too, based on your experience.
but today is hardly a deal breaker, once the linking is going I don't pay too much attention to the build system..
2
u/Jannik2099 Dec 24 '24
Since xmake is written in lua I consider it pretty much ineligible. The lua language lacks any clear standardization or coordination effort, it feels odd to base a build system around that.
I am very happy with meson however. Granted, they are still working on C++20 modules.
1
u/[deleted] Dec 24 '24
When Conan integrates well ill try it.
1
u/krispy86 May 03 '25
I've messed around with xmake a bit now but I find it really horrible that the linker is always g++ for C projects unless I force it to be something else. This of course makes no sense if my compiler is gcc then link with gcc, if it is clang then use clang. If there is some way to make this work in a better way let me know.
0
u/Superb_Garlic Dec 24 '24
No thanks. CMake does everything well and the xmake build code I have seen is not any better quality than your average CMake code. People just refuse to actually learn build tools.
xmake's readme doesn't help with this either: https://github.com/xmake-io/xmake/?tab=readme-ov-file#automatically-fetch-remote-toolchain
Why the hell is the toolchain hardcoded in the build description? Toolchains are a hard requirement only in very few select cases! This pseudo block indentation for targets is also annoying to look at.
-5
u/JumpyJustice Dec 24 '24
The tool looks cool. But its main contributor is chinese person whose profile has this project and tools for hacking 🤔
0
u/Banishlight Dec 24 '24
I still write make files for my projects.. Am I missing out on much?