summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-23 22:26:44 +0800
committerruki <[email protected]>2024-08-23 22:26:44 +0800
commit3d7af5a90d3bc60a68dfde16d12cb3e79bceb8cf (patch)
tree6cdc2aa0f68c310d1c477ab6c983094d84f6c9ec /xmake/modules/core/tools/cl.lua
parentb9b89f95ef87dcbe86213967ebc98258d4715dbe (diff)
improve vectorexts
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index db2f32662..dab766482 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -219,14 +219,18 @@ function nf_vectorext(self, extension)
local flags = maps[extension]
if flags then
-- @see https://github.com/xmake-io/xmake/issues/5499
- local result = {}
- for _, flag in ipairs(flags) do
- if self:has_flags(flag, "cxflags") then
- table.insert(result, flag)
+ if type(flags) == "string" then
+ return flags
+ else
+ local result = {}
+ for _, flag in ipairs(flags) do
+ if self:has_flags(flag, "cxflags") then
+ table.insert(result, flag)
+ end
+ end
+ if #result > 0 then
+ return table.unwrap(result)
end
- end
- if #result > 0 then
- return table.unwrap(result)
end
end
end
@@ -781,3 +785,4 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
end
end
end
+