diff options
Diffstat (limited to 'xmake/rules/dlang/xmake.lua')
| -rw-r--r-- | xmake/rules/dlang/xmake.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/rules/dlang/xmake.lua b/xmake/rules/dlang/xmake.lua index 3e123e0d8..cebbaef3e 100644 --- a/xmake/rules/dlang/xmake.lua +++ b/xmake/rules/dlang/xmake.lua @@ -18,12 +18,16 @@ -- @file xmake.lua -- --- define rule: dlang.build rule("dlang.build") set_sourcekinds("dc") on_build_files("private.action.build.object", {batch = true}) + on_load(function (target) + local toolchains = target:get("toolchains") or get_config("toolchain") + if not toolchains or not table.contains(table.wrap(toolchains), "dlang", "dmd", "ldc", "gdc") then + target:add("toolchains", "dlang") + end + end) --- define rule: dlang rule("dlang") -- add build rules |
