summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua15
1 files changed, 12 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index c4eede192..db2f32662 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -216,9 +216,18 @@ function nf_vectorext(self, extension)
, fma = "-arch:AVX2"
, all = {"-arch:SSE", "-arch:SSE2", "/d2archSSE42", "-arch:AVX", "-arch:AVX2", "-arch:AVX512"}
}
- local flag = maps[extension]
- if flag and self:has_flags(flag, "cxflags") then
- return flag
+ 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)
+ end
+ end
+ if #result > 0 then
+ return table.unwrap(result)
+ end
end
end