Skip to content

Commit 3d7af5a

Browse files
committed
improve vectorexts
1 parent b9b89f9 commit 3d7af5a

File tree

1 file changed

+12
-7
lines changed
  • xmake/modules/core/tools

1 file changed

+12
-7
lines changed

xmake/modules/core/tools/cl.lua

+12-7
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,18 @@ function nf_vectorext(self, extension)
219219
local flags = maps[extension]
220220
if flags then
221221
-- @see https://github.com/xmake-io/xmake/issues/5499
222-
local result = {}
223-
for _, flag in ipairs(flags) do
224-
if self:has_flags(flag, "cxflags") then
225-
table.insert(result, flag)
222+
if type(flags) == "string" then
223+
return flags
224+
else
225+
local result = {}
226+
for _, flag in ipairs(flags) do
227+
if self:has_flags(flag, "cxflags") then
228+
table.insert(result, flag)
229+
end
230+
end
231+
if #result > 0 then
232+
return table.unwrap(result)
226233
end
227-
end
228-
if #result > 0 then
229-
return table.unwrap(result)
230234
end
231235
end
232236
end
@@ -781,3 +785,4 @@ function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
781785
end
782786
end
783787
end
788+

0 commit comments

Comments
 (0)