3 ms·
> not have `target("name", function (ctx) ... end)`. It supports this syntax. https://xmake.io/guide/project-configuration/syntax-description.html#optional-sc
by danny0z 8mo ago
> not have `target("name", function (ctx) ... end)`.
It supports this syntax.
https://xmake.io/guide/project-configuration/syntax-description.html#optional-scope-configuration-syntax https://xmake.io/guide/project-configuration/syntax-descript...
target("foo", function ()
set_kind("binary")
add_files("src/*.cpp")
add_defines("FOO")
end)
- warmwaffles 8mo agoI did not spot those in the docs. Thanks a ton. This will help my autoformatter not completely wreck my files.
- numeromancer 8mo agoI 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.
- danny0z 8mo agoIt also supports this syntax. target("foo", { kind = "binary", files = { "src/*.cpp" }, includedirs = { "src" }, defines = { "FOO", "BAR=BAZ" }, }) https://xmake.io/guide/project-configuration/syntax-description.html#syntax-simplification https://xmake.io/guide/project-configuration/syntax-descript...
- numeromancer 8mo agoThat's what I meant: the first you can do, the second, not.