diff options
| author | ruki <[email protected]> | 2022-10-19 00:58:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-19 00:58:10 +0800 |
| commit | 9b1e01c0b6deb3eaae25038643e11ea482ea248a (patch) | |
| tree | e0911a64e8819432483fb948915f4f85c7efb001 | |
| parent | 78fe5e017f14b4459a36b27548d98af9485e9fff (diff) | |
use sysincludedirs
| -rw-r--r-- | xmake/core/base/table.lua | 2 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/lib/detect/find_package.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/package/manager/xmake/find_package.lua | 4 |
4 files changed, 17 insertions, 3 deletions
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua index 5e04b0256..a360f7b42 100644 --- a/xmake/core/base/table.lua +++ b/xmake/core/base/table.lua @@ -155,7 +155,7 @@ end -- clone table function table.clone(self) - local result + local result = self if type(self) == "table" then result = {} for k, v in pairs(self) do diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 1729eaa00..81b66b945 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -1482,12 +1482,21 @@ function _instance:_fetch_library(opt) end end if fetchinfo then + local components_base = fetchinfo.components and fetchinfo.components.__base if opt.external then fetchinfo.sysincludedirs = fetchinfo.sysincludedirs or fetchinfo.includedirs fetchinfo.includedirs = nil + if components_base then + components_base.sysincludedirs = components_base.sysincludedirs or components_base.includedirs + components_base.includedirs = nil + end else fetchinfo.includedirs = fetchinfo.includedirs or fetchinfo.sysincludedirs fetchinfo.sysincludedirs = nil + if components_base then + components_base.includedirs = components_base.includedirs or components_base.sysincludedirs + components_base.sysincludedirs = nil + end end end if fetchinfo and option.get("verbose") then diff --git a/xmake/modules/lib/detect/find_package.lua b/xmake/modules/lib/detect/find_package.lua index d3c9e57d1..dc1c92848 100644 --- a/xmake/modules/lib/detect/find_package.lua +++ b/xmake/modules/lib/detect/find_package.lua @@ -112,6 +112,11 @@ function main(name, opt) if result and result.includedirs and opt.external then result.sysincludedirs = result.includedirs result.includedirs = nil + local components_base = result.components and result.components.__base + if components_base then + components_base.sysincludedirs = components_base.includedirs + components_base.includedirs = nil + end end -- cache result diff --git a/xmake/modules/package/manager/xmake/find_package.lua b/xmake/modules/package/manager/xmake/find_package.lua index f55601596..10c58436a 100644 --- a/xmake/modules/package/manager/xmake/find_package.lua +++ b/xmake/modules/package/manager/xmake/find_package.lua @@ -183,11 +183,11 @@ function _find_package_from_repo(name, opt) end -- inherit the other prefix variables - local components_base = {includedirs = result.includedirs, linkdirs = result.linkdirs} + local components_base = {includedirs = table.clone(result.includedirs), linkdirs = table.clone(result.linkdirs)} for name, values in pairs(vars) do if name ~= "links" and name ~= "linkdirs" and name ~= "includedirs" then result[name] = values - components_base[name] = values + components_base[name] = table.clone(values) end end |
