diff options
| author | ruki <[email protected]> | 2021-07-23 00:43:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-07-23 00:43:55 +0800 |
| commit | 6fddc9c0d0532e5f66be3e9713498638496ffe7f (patch) | |
| tree | 5d9799ee97c421d966d2391c73eed9f135ab8a3e | |
| parent | 049460cc578b7d74b99ef3cffe3fe1d3e9eb6439 (diff) | |
improve allowed archs
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x.lua | 12 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua index a66761d4d..da0dd9317 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x.lua @@ -212,7 +212,17 @@ function _make_vsinfo_archs() end else -- we use it first if global set_arch("xx") is setted in xmake.lua - vsinfo_archs = project.get("target.arch") or platform.archs() + vsinfo_archs = project.get("target.arch") + if not vsinfo_archs then + -- for set_allowedarchs() + local allowed_archs = project.allowed_archs(config.plat()) + if allowed_archs then + vsinfo_archs = allowed_archs:to_array() + end + end + if not vsinfo_archs then + vsinfo_archs = platform.archs() + end end if not vsinfo_archs or #vsinfo_archs == 0 then vsinfo_archs = { config.arch() } diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 407e4cbe4..965e55028 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -262,7 +262,17 @@ function _make_vsinfo_archs() end else -- we use it first if global set_arch("xx") is setted in xmake.lua - vsinfo_archs = project.get("target.arch") or platform.archs() + vsinfo_archs = project.get("target.arch") + if not vsinfo_archs then + -- for set_allowedarchs() + local allowed_archs = project.allowed_archs(config.plat()) + if allowed_archs then + vsinfo_archs = allowed_archs:to_array() + end + end + if not vsinfo_archs then + vsinfo_archs = platform.archs() + end end if not vsinfo_archs or #vsinfo_archs == 0 then vsinfo_archs = { config.arch() } |
