summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-02 20:32:53 +0800
committerGitHub <[email protected]>2022-07-02 20:32:53 +0800
commit0e77badced0a9e0c9e8aec10fb6c4f324616078c (patch)
tree47d6fe4a8adb8864ceddd896a127fb3e9d889465 /xmake/modules/package/tools/xmake.lua
parent5708a5c03d35f8761c3d6d07bbb3f6149a879f23 (diff)
parentbec05e2418d6c2055cd729b7b4e0de7210091473 (diff)
Merge pull request #2523 from xmake-io/lto
Add better LTO support
Diffstat (limited to 'xmake/modules/package/tools/xmake.lua')
-rw-r--r--xmake/modules/package/tools/xmake.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index 6e98adc7b..b871afcd2 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -94,6 +94,9 @@ function _get_configs(package, configs)
end
end
end
+ if package:config("lto") then
+ table.insert(configs, "--policies=build.optimization.lto")
+ end
if not package:is_plat("windows", "mingw") and package:config("pic") ~= false then
table.insert(cxflags, "-fPIC")
end