summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/link.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-07-31 22:45:10 +0800
committerruki <[email protected]>2020-07-31 22:45:10 +0800
commitc63545cbe59c57f370abd7c93f8977836f4f0e14 (patch)
tree1b45b8f94c7e2aa027cf1246b04b59cdf8294333 /xmake/modules/core/tools/link.lua
parentd120256e16d2f1ea1b610390dd0e34737f410b54 (diff)
strip codes for msvc
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
-rw-r--r--xmake/modules/core/tools/link.lua15
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua
index 10a242e6d..98dc98982 100644
--- a/xmake/modules/core/tools/link.lua
+++ b/xmake/modules/core/tools/link.lua
@@ -57,6 +57,19 @@ function get(self, name)
return values
end
+-- make the strip flag
+function nf_strip(self, level)
+ -- @note we explicitly strip some useless code, because `/debug` may keep them
+ -- @see https://github.com/xmake-io/xmake/issues/907
+ --
+ local maps =
+ {
+ debug = "/opt:ref /opt:icf"
+ , all = "/opt:ref /opt:icf /ltcg" -- we enable /ltcg for optimize/smallest:/Gl
+ }
+ return maps[level]
+end
+
-- make the symbol flag
function nf_symbol(self, level, target)
@@ -70,8 +83,6 @@ function nf_symbol(self, level, target)
flags = "-debug"
end
end
-
- -- none
return flags
end