diff options
| author | ruki <[email protected]> | 2022-07-20 22:29:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-20 22:29:59 +0800 |
| commit | 5dd962d1b0e51b839f88b580c5586ef8cfca3c60 (patch) | |
| tree | cf54dc42393ab414e31ad94c3dc6a2940e7c51c8 /xmake/modules | |
| parent | ed3952947afe5ca5b24bf8dff7ead73d037bee2b (diff) | |
add package:use_external_includes
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 7 |
2 files changed, 8 insertions, 8 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 diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 174c67148..aa7fc9b96 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -492,13 +492,6 @@ function _finish_requireinfo(requireinfo, package) requireinfo.configs.vs_runtime = "MT" end end - local external = project.policy("package.include_external_headers") - if external == nil then - external = package:policy("package.include_external_headers") - end - if requireinfo.external == nil and external ~= nil then - requireinfo.external = external - end -- we need ensure readonly configs for _, name in ipairs(table.keys(requireinfo.configs)) do if package:extraconf("configs", name, "readonly") then |
