summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorTiangang Song <[email protected]>2026-05-03 11:39:39 -0700
committerTiangang Song <[email protected]>2026-05-04 20:30:55 -0700
commitbbcf7a801e637b89a005751c6bfdf7bfcaa48de8 (patch)
tree3c6ded46cac4adfc188ee2b2cbe0816d309aa776 /xmake/core
parent931fce9c311f25aca6091d226b48f72b1dc548c9 (diff)
Fix lto with zig cc and clang_cl
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/package/package.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 636b717c2..95ee2a01b 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -2426,9 +2426,9 @@ function _instance:_generate_lto_configs(sourcekind)
if sourcekind then
local _, cc = self:tool(sourcekind)
local cflag = sourcekind == "cxx" and "cxxflags" or "cflags"
- if cc == "cl" then
+ if cc == "cl" or cc == "clang_cl" then
configs[cflag] = "-GL"
- elseif cc == "clang" or cc == "clangxx" or cc == "clang_cl" then
+ elseif cc == "clang" or cc == "clangxx" or cc:startswith("zig") then
configs[cflag] = "-flto=thin"
elseif cc == "gcc" or cc == "gxx" then
configs[cflag] = "-flto"
@@ -2440,7 +2440,7 @@ function _instance:_generate_lto_configs(sourcekind)
if ld == "link" then
configs.ldflags = "-LTCG"
configs.shflags = "-LTCG"
- elseif ld == "clang" or ld == "clangxx" then
+ elseif ld == "clang" or ld == "clangxx" or ld:startswith("zig") then
configs.ldflags = "-flto=thin"
configs.shflags = "-flto=thin"
elseif ld == "gcc" or ld == "gxx" then