diff options
| author | ruki <[email protected]> | 2022-07-20 00:45:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-20 00:45:21 +0800 |
| commit | ed3952947afe5ca5b24bf8dff7ead73d037bee2b (patch) | |
| tree | a2da2055449d9fca5a362baf6f18f944644fe33f /xmake/modules/package/tools/xmake.lua | |
| parent | a3f498eafe30d7b43de93e89ad42b9c86e025e14 (diff) | |
pass policies to xmake packages #2566
Diffstat (limited to 'xmake/modules/package/tools/xmake.lua')
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index 4d2294d40..8d9b2f0c4 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -98,8 +98,16 @@ function _get_configs(package, configs) end end end + local policies = get_config("policies") if package:config("lto") then - table.insert(configs, "--policies=build.optimization.lto") + if policies then + policies = policies .. ",build.optimization.lto" + else + policies = "build.optimization.lto" + end + end + if policies then + table.insert(configs, "--policies=" .. policies) end if not package:is_plat("windows", "mingw") and package:config("pic") ~= false then table.insert(cxflags, "-fPIC") |
