summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-20 22:29:59 +0800
committerruki <[email protected]>2022-07-20 22:29:59 +0800
commit5dd962d1b0e51b839f88b580c5586ef8cfca3c60 (patch)
treecf54dc42393ab414e31ad94c3dc6a2940e7c51c8 /xmake/modules/package/tools/xmake.lua
parented3952947afe5ca5b24bf8dff7ead73d037bee2b (diff)
add package:use_external_includes
Diffstat (limited to 'xmake/modules/package/tools/xmake.lua')
-rw-r--r--xmake/modules/package/tools/xmake.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index 8d9b2f0c4..cfb22f6dd 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -99,13 +99,20 @@ function _get_configs(package, configs)
end
end
local policies = get_config("policies")
- if package:config("lto") then
+ if package:config("lto") and (not policies or not policies:find("build.optimization.lto", 1, true)) then
if policies then
policies = policies .. ",build.optimization.lto"
else
policies = "build.optimization.lto"
end
end
+ if not package:use_external_includes() and (not policies or not policies:find("package.include_external_headers", 1, true)) then
+ if policies then
+ policies = policies .. ",package.include_external_headers:n"
+ else
+ policies = "package.include_external_headers:n"
+ end
+ end
if policies then
table.insert(configs, "--policies=" .. policies)
end