diff options
| author | ruki <[email protected]> | 2022-07-02 20:32:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-07-02 20:32:53 +0800 |
| commit | 0e77badced0a9e0c9e8aec10fb6c4f324616078c (patch) | |
| tree | 47d6fe4a8adb8864ceddd896a127fb3e9d889465 /xmake/modules/private/action/require/impl/package.lua | |
| parent | 5708a5c03d35f8761c3d6d07bbb3f6149a879f23 (diff) | |
| parent | bec05e2418d6c2055cd729b7b4e0de7210091473 (diff) | |
Merge pull request #2523 from xmake-io/lto
Add better LTO support
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index ca11a10d3..cf330f308 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -310,6 +310,9 @@ function _add_package_configurations(package) if package:extraconf("configs", "pic", "default") == nil then package:add("configs", "pic", {builtin = true, description = "Enable the position independent code.", default = true, type = "boolean"}) end + if package:extraconf("configs", "lto", "default") == nil then + package:add("configs", "lto", {builtin = true, description = "Enable the link-time build optimization.", type = "boolean"}) + end if package:extraconf("configs", "vs_runtime", "default") == nil then package:add("configs", "vs_runtime", {builtin = true, description = "Set vs compiler runtime.", values = {"MT", "MTd", "MD", "MDd"}}) end @@ -474,6 +477,7 @@ function _init_requireinfo(requireinfo, package, opt) if project.policy("package.inherit_external_configs") then requireinfo.configs.vs_runtime = requireinfo.configs.vs_runtime or get_config("vs_runtime") end + requireinfo.configs.lto = requireinfo.configs.lto or project.policy("build.optimization.lto") end end end |
