HN2new | past | comments | ask | show | jobs | submit | danny0z's commentslogin

> not have `target("name", function (ctx) ... end)`.

It supports this syntax.

https://xmake.io/guide/project-configuration/syntax-descript...

  target("foo", function ()
      set_kind("binary")
      add_files("src/*.cpp")
      add_defines("FOO")
  end)


I think the creators did it a disservice to xmake when they tried to unluaize the syntax. You can also do:

    target("foo", {
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    })
which suits Lua better. Unfortunately you cannot do

    target {
      name = "foo",
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    }
which would be the lua-est lua of all.


It also supports this syntax.

    target("foo", {
      kind = "binary",
      files = { "src/*.cpp" },
      includedirs = { "src" },
      defines = { "FOO", "BAR=BAZ" },
    })
https://xmake.io/guide/project-configuration/syntax-descript...


That's what I meant: the first you can do, the second, not.


I did not spot those in the docs. Thanks a ton. This will help my autoformatter not completely wreck my files.


It can generate a Visual Studio project, then use the xmake CLI to integrate and compile the project, and supports debugging and IntelliSense.

https://xmake.io/guide/extensions/builtin-plugins.html#gener...

C++ Modules examples:

https://xmake.io/examples/cpp/cxx-modules.html

https://github.com/xmake-io/xmake/tree/dev/tests/projects/c%...


Thanks for the information.


xmake also support D and dub.


The other great thing about D is you don't need anything like that

Example:

    dmd -i -Isrc/ src/main.d
and the compiler will automatically grab files you import, and when you need packages you can rely on dub, compiler is so fast that in most cases you don't need any form of caching, a full rebuild of my game takes less than 1sec


we can also try xmake. https://github.com/xmake-io/xmake

Xmake can be used to directly build source code (like with Make or Ninja), or it can generate project source files like CMake or Meson. It also has a built-in package management system to help users integrate C/C++ dependencies.


Xmake is also based on tbox as a c base library.


I’m trying to compile from source, and since that needs xmake I’m now trying to build it.

Following the instructions, after `make build` I get “No rule to make target 'lua/lapi.c', needed by 'lua/lapi.o'. Stop.”.

I’m now reading more, and it will probably be some easy thing.

My advice would be to have some compact list of steps to get it up and running from source without having to install binaries. I think that would make it easier to try out.

I’ll now continue trying to figure out what’s missing.


we need pull all submodules, you can see https://xmake.io/#/guide/installation?id=installation

    git submodule update --init
Or you can download full source code from releases. https://github.com/xmake-io/xmake/releases/download/v2.6.5/x...


> Or you can download full source code from releases. https://github.com/xmake-io/xmake/releases/download/v2.6.5/x...

Yes, that’s what I did. :-)

    wget https://github.com/xmake-io/xmake/archive/refs/tags/v2.6.5.tar.gz 
    tar xf v2.6.5.tar.gz
    cd xmake-2.6.5/
    make build


no, it should be `v2.6.5/xmake-v2.6.5.tar.gz` instead of `tags/v2.6.5.tar.gz`

    https://github.com/xmake-io/xmake/releases/download/v2.6.5/xmake-v2.6.5.tar.gz


Ah, I see. That might be Github’s problem, but the link I used is the one at the bottom of the list labeled “Source code”: https://github.com/xmake-io/xmake/releases/tag/v2.6.5

I see that one you mention in the middle of the list, with the name “xmake-v2.6.5.tar.gz”.

Please note that this is not a criticism, I’m just telling what can happen when someone tries to compile it.

Edit: trying this now:

    wget https://github.com/xmake-io/xmake/releases/download/v2.6.5/xmake-v2.6.5.tar.gz
    tar xf xmake-v2.6.5.tar.gz 
    cd xmake
    make build
I get “make: ** No rule to make target 'build'. Stop.”, because there is no `makefile` or `Makefile` in there.

Edit 2: I see, the issue is that it does not create a directory `xmake-v2.6.5`, but instead extracts its contents in the current directory, as a “tar bomb”. This works:

    mkdir xmake-v2.6.5
    cd xmake-v2.6.5
    wget https://github.com/xmake-io/xmake/releases/download/v2.6.5/xmake-v2.6.5.tar.gz
    tar xf xmake-v2.6.5.tar.gz 
    make build


Github’s auto-generated source tars don’t include submodules.

https://github.com/dear-github/dear-github/issues/214


try

    wget https://github.com/xmake-io/xmake/releases/download/v2.6.5/xmake-v2.6.5.tar.gz
    tar xf xmake-v2.6.5.tar.gz 
    make build
we need not run `cd xmake`


you can also try xmake. It use lua, not DSL.

https://github.com/xmake-io/xmake



Xmake has Clion/IDEA, vscode, vs, sublime and qtcreator plugin.


> Xmake has Clion/IDEA, vscode, vs, sublime and qtcreator plugin.

Correct me if I'm wrong, but a quick search for Clion's support for xmake only returns a dead plugin from intellij which was last updated 4 years ago.

https://plugins.jetbrains.com/plugin/10156-xmake

Meanwhile, Clion is built around cmake. Why would any Clion customer want to drop first-class support for cmake to fall back to an unmaintained plugin that seems to be abandonware?



But they are not officially supported plugins, while CMake has official support from major companies and IDE makers, namely Microsoft, Jetbrains, Qt Company. Further comments in this threads also pointed out that some Plugins for Clion are abandonware and may no longer work.

A reason for using Cmake is that this build system's CMakeLists.txt also works like a universal IDE-agnostic project file that saves the user from wasting time tinkering IDEs and lots of XML files in the case of Visual Studio MSBUILD building system.


xmake can also easily write some lua scripts to dump the build dependency graph https://github.com/xmake-io/xmake


Interesting, what is the difference between it and other build tools, such as cmake, meson?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: