summaryrefslogtreecommitdiff
path: root/xmake/core/package/addon.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-12 00:35:48 +0800
committerruki <[email protected]>2026-08-12 00:35:48 +0800
commit56a581b37b3c4e7d8b96415a03f850db827956ab (patch)
treedf58b1231679ed59d9266ae792b21fe7f5b7c3de /xmake/core/package/addon.lua
parent6b35c254f0f918c05989b7e62cfd8bca87cc97b5 (diff)
improve addon and comment
Diffstat (limited to 'xmake/core/package/addon.lua')
-rw-r--r--xmake/core/package/addon.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/xmake/core/package/addon.lua b/xmake/core/package/addon.lua
index 1f116bcd4..586a3ea15 100644
--- a/xmake/core/package/addon.lua
+++ b/xmake/core/package/addon.lua
@@ -166,11 +166,14 @@ function addon._check_conflicts(dirname, addoninfo)
end
end
- -- the global modules can also conflict with the builtin ones
+ -- the global modules can also conflict with the builtin and the user modules
for _, name in ipairs(addoninfo.globalmodules or {}) do
- local modulefile = path.join(os.programdir(), "modules", (name:gsub("%.", "/")) .. ".lua")
- if os.isfile(modulefile) then
- return string.format("global module(%s) conflicts, it has been provided by xmake!\nplease rename it in the addon manifest.", name)
+ local modulepath = (name:gsub("%.", "/")) .. ".lua"
+ for _, moduledir in ipairs({os.programdir(), global.directory()}) do
+ if os.isfile(path.join(moduledir, "modules", modulepath)) then
+ return string.format("global module(%s) conflicts, it has been provided by %s!\nplease rename it in the addon manifest.",
+ name, moduledir == os.programdir() and "xmake" or path.join(moduledir, "modules"))
+ end
end
end
end