summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-02 19:20:42 +0800
committerruki <[email protected]>2022-07-02 19:20:42 +0800
commitbec05e2418d6c2055cd729b7b4e0de7210091473 (patch)
tree47d6fe4a8adb8864ceddd896a127fb3e9d889465
parent84b9ffd0a471d1de858efc3c767a4a527ab6567a (diff)
fix link for msvc
-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