diff options
| author | ruki <[email protected]> | 2024-08-23 22:25:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-23 22:25:08 +0800 |
| commit | b9b89f95ef87dcbe86213967ebc98258d4715dbe (patch) | |
| tree | e9c220e69703c8eaa8142b9a361921e999263514 /xmake/modules/core/tools/cl.lua | |
| parent | 57df37f3d8e15a74cf9148471ba0cf6d13a11c53 (diff) | |
improve vectorext #5499
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 15 |
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 |
