From 5522c0c028562b4ede39bd5dbc5ee0aba91b4049 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 11 Apr 2026 21:37:20 +0800 Subject: improve moduledirs --- xmake/core/project/project.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 5376f406d..2ea22e655 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -220,12 +220,16 @@ function project._api_add_toolchaindirs(interp, ...) -- so that custom toolchain can bundle its tool modules together local toolchain_subdirs = os.dirs(path.join(dir, "*")) if toolchain_subdirs then + local modulesdirs = {} for _, toolchain_subdir in ipairs(toolchain_subdirs) do local modulesdir = path.join(toolchain_subdir, "modules") if os.isdir(modulesdir) then - sandbox_module.add_directories(modulesdir) + table.insert(modulesdirs, modulesdir) end end + if #modulesdirs > 0 then + sandbox_module.add_directories(table.unpack(modulesdirs)) + end end end end -- cgit v1.3.1