TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

186 点作者 waruqi大约 6 年前

22 条评论

soapdog大约 6 年前
a developer post a well rounded tool with documentation that was built with a lot of care. The comment thread is mostly about other tools or people dismissing the work done because another available offer is more popular or common.<p>When did &quot;Show HN&quot; threads became shark tank? Can people at least check and post about the tool itself instead of discussing CMake vs Ninja vs Meson?
评论 #19612758 未加载
评论 #19614394 未加载
评论 #19612828 未加载
评论 #19613375 未加载
2bluesc大约 6 年前
Meson[0] has been gaining in popularity and has migration tools for cmake projects.<p>Large projects such as systemd and gnome[1] have migrated or have been migrating for years<p>[0] <a href="https:&#x2F;&#x2F;mesonbuild.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mesonbuild.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;wiki.gnome.org&#x2F;Initiatives&#x2F;GnomeGoals&#x2F;MesonPorting" rel="nofollow">https:&#x2F;&#x2F;wiki.gnome.org&#x2F;Initiatives&#x2F;GnomeGoals&#x2F;MesonPorting</a>
评论 #19610984 未加载
评论 #19612935 未加载
评论 #19612462 未加载
评论 #19614303 未加载
评论 #19614338 未加载
评论 #19611253 未加载
评论 #19611191 未加载
评论 #19613112 未加载
waruqi大约 6 年前
We can see an example about xmake.lua<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tboox&#x2F;tbox&#x2F;blob&#x2F;master&#x2F;src&#x2F;tbox&#x2F;xmake.lua" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tboox&#x2F;tbox&#x2F;blob&#x2F;master&#x2F;src&#x2F;tbox&#x2F;xmake.lua</a>
claudius大约 6 年前
What I miss about these tools is some &quot;relatively&quot; straightforward dependency detection and generation.<p>That is, I have a bunch of .cpp files which need to be compiled into individual executables in a folder bin&#x2F;. I also have a folder inc&#x2F; which contains some headers (.h) and those headers possibly also have some associated TU (.cpp).<p>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.<p>That is, I can simply create a new &quot;executable file&quot; .cpp file in bin&#x2F;, 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.<p>Now that I have these &quot;relatively straightforward&quot; 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&#x27;s view of the world is quite low – unless there is some way to do this directly?<p>Xmake as shown here (and also Meson linked in a sister comment) appear to still require manual selection of dependencies.
评论 #19613585 未加载
评论 #19612814 未加载
评论 #19612880 未加载
评论 #19612920 未加载
评论 #19612674 未加载
jhauris大约 6 年前
This is really great work, great documentation. It looks like CMake, but with a full featured scripting language.
评论 #19614568 未加载
Game_Ender大约 6 年前
Does it have any distributed build or caching support? That is my minimum bar for a C++ build system. ccache and distcc&#x2F;icecc are too limited, you want something integrated with your build system directly.
评论 #19611304 未加载
RcouF1uZ4gsC大约 6 年前
For better or worse though, CMake has won! Many IDE&#x27;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 <a href="https:&#x2F;&#x2F;abseil.io&#x2F;blog&#x2F;20190402-cmake-support" rel="nofollow">https:&#x2F;&#x2F;abseil.io&#x2F;blog&#x2F;20190402-cmake-support</a><p>If you are writing an open source C++ library, even if you support some other C++ build system, chances are you will also have CMake support as well.<p>While I have no doubt, xmake is easier to use than CMake (just having Lua over CMake&#x27;s abomination of a language is a great improvement), the fact that so many libraries and tools already support CMake is going to make adoption an uphill battle.
评论 #19612202 未加载
评论 #19611008 未加载
评论 #19612975 未加载
waruqi大约 6 年前
Here is an official dependency package repository for xmake. <a href="https:&#x2F;&#x2F;github.com&#x2F;xmake-io&#x2F;xmake-repo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xmake-io&#x2F;xmake-repo</a>
waruqi大约 6 年前
One of the purposes of xmake is to solve the problem of C&#x2F;C++ dependency packages.
评论 #19612182 未加载
Iwan-Zotow大约 6 年前
cmake is NOT a build utility. It is dependency tracking and configuration utility
评论 #19610918 未加载
评论 #19610922 未加载
euyyn大约 6 年前
Does it produce hermetic builds?
评论 #19610869 未加载
je42大约 6 年前
mmh. cflags and cxxflags are command line options ? i would expect them to be defined as part of build file.
评论 #19611365 未加载
评论 #19612231 未加载
phaedrus大约 6 年前
I wish CLion supported this as an alternative to CMake for project definitions!
评论 #19615600 未加载
intea大约 6 年前
Im not a fan of LUA. The syntax of XMake.lua reads somewhat like CMake but easier to understand. What I&#x27;d really like to see is a build system in Python (3!) utilizing objects and dictionaries for tasks like this should be a breeze.
评论 #19613772 未加载
评论 #19613767 未加载
unrealhoang大约 6 年前
Now we have N+1 incompatibile build systems.
评论 #19610959 未加载
评论 #19612211 未加载
评论 #19610833 未加载
评论 #19610881 未加载
peterownen2大约 6 年前
I really love it! When did you start the project?
_pmf_大约 6 年前
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.<p>Conan and Meson seem so much better in that regard.
评论 #19612624 未加载
caikelun大约 6 年前
great!!
fxfan大约 6 年前
This looks thoughtfully created (and so documented!). I haven&#x27;t gone through the entire doc and am not particularly clear but can you cross-build too? How would you run MSVC linker on Linux?
评论 #19612392 未加载
honey1988大约 6 年前
Great!
kayamon大约 6 年前
Don’t ever install software by piping arbitrary remote scripts into bash.
评论 #19611117 未加载
评论 #19612846 未加载
评论 #19611000 未加载
评论 #19610997 未加载
godman_8大约 6 年前
It has an emoji in the title...I&#x27;m sold.