summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/package/package.lua2
-rw-r--r--xmake/rules/c++/build_optimization/load.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index a9f39e208..9dad30ab1 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1709,7 +1709,7 @@ function _instance:_generate_lto_configs(sourcekind)
-- add ldflags and shflags
local _, ld = self:tool("ld")
- if ld == "cl" then
+ if ld == "link" then
configs.ldflags = "-LTCG"
configs.shflags = "-LTCG"
elseif ld == "clang" or ld == "clangxx" then
diff --git a/xmake/rules/c++/build_optimization/load.lua b/xmake/rules/c++/build_optimization/load.lua
index b5bdf07a1..bd1831778 100644
--- a/xmake/rules/c++/build_optimization/load.lua
+++ b/xmake/rules/c++/build_optimization/load.lua
@@ -38,7 +38,7 @@ function _add_lto_optimization(target, sourcekind)
-- add ldflags and shflags
local _, ld = target:tool("ld")
- if ld == "cl" then
+ if ld == "link" then
target:add("ldflags", "-LTCG")
target:add("shflags", "-LTCG")
elseif ld == "clang" or ld == "clangxx" then