summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-04-11 21:37:20 +0800
committerruki <[email protected]>2026-04-11 21:37:43 +0800
commit5522c0c028562b4ede39bd5dbc5ee0aba91b4049 (patch)
tree0aceb4eaf6f322579c1c3071e068424e9c0c2d6e
parent8d8601bb1655094e1c711f8a48150453f076b5d1 (diff)
improve moduledirs
-rw-r--r--xmake/core/project/project.lua6
1 files changed, 5 insertions, 1 deletions
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