summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-27 23:26:18 +0800
committerruki <[email protected]>2023-02-27 14:38:46 +0800
commit58b151f08ab263a9ff3f9de0943a8ef142c2c2a4 (patch)
tree9415c558816d6c4f967c12feb329db9d45cd37db
parent7fa4d6545b43ae3ab7e3d31d5a0c3ff0dc9c9181 (diff)
improve has_flags
-rw-r--r--xmake/core/language/language.lua2
-rw-r--r--xmake/modules/lib/detect/has_flags.lua2
2 files changed, 3 insertions, 1 deletions
diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua
index a71a0cb1e..557839959 100644
--- a/xmake/core/language/language.lua
+++ b/xmake/core/language/language.lua
@@ -239,7 +239,7 @@ function language.load(name)
-- load all languages
if not name then
if not language._LANGUAGES then
- for _, name in ipairs(table.wrap(os.match(path.join(language._directory(), "*"), true))) do
+ for _, name in ipairs(table.wrap(os.dirs(path.join(language._directory(), "*")))) do
local instance, errors = language.load(path.basename(name))
if not instance then
return nil, errors
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index 88bb958b5..1d5cd3848 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -43,6 +43,8 @@ import("lib.detect.find_tool")
function main(name, flags, opt)
-- wrap flags first
+ flags = table.clone(flags)
+ table.wrap_unlock(flags)
flags = table.wrap(flags)
-- init options