diff options
| author | ruki <[email protected]> | 2020-07-31 22:45:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-07-31 22:45:10 +0800 |
| commit | c63545cbe59c57f370abd7c93f8977836f4f0e14 (patch) | |
| tree | 1b45b8f94c7e2aa027cf1246b04b59cdf8294333 /xmake/modules/core/tools/link.lua | |
| parent | d120256e16d2f1ea1b610390dd0e34737f410b54 (diff) | |
strip codes for msvc
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
| -rw-r--r-- | xmake/modules/core/tools/link.lua | 15 |
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 |
