Skip to content

Commit b9b89f9

Browse files
committed
improve vectorext #5499
1 parent 57df37f commit b9b89f9

File tree

1 file changed

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

1 file changed

+12
-3
lines changed

xmake/modules/core/tools/cl.lua

+12-3
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,18 @@ function nf_vectorext(self, extension)
216216
, fma = "-arch:AVX2"
217217
, all = {"-arch:SSE", "-arch:SSE2", "/d2archSSE42", "-arch:AVX", "-arch:AVX2", "-arch:AVX512"}
218218
}
219-
local flag = maps[extension]
220-
if flag and self:has_flags(flag, "cxflags") then
221-
return flag
219+
local flags = maps[extension]
220+
if flags then
221+
-- @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)
226+
end
227+
end
228+
if #result > 0 then
229+
return table.unwrap(result)
230+
end
222231
end
223232
end
224233

0 commit comments

Comments
 (0)