diff options
| -rw-r--r-- | xmake/actions/config/main.lua | 12 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/xmake/actions/config/main.lua b/xmake/actions/config/main.lua index d96f32a9e..4e6e7fce0 100644 --- a/xmake/actions/config/main.lua +++ b/xmake/actions/config/main.lua @@ -221,12 +221,20 @@ function _check_configs() end -- check allowed archs + local plat = config.plat() local arch = config.arch() local allowedarchs = table.wrap(project.get("allowedarchs")) if #allowedarchs > 0 then - local allowedarchs_set = hashset.from(allowedarchs) + local allowedarchs_current = {} + for _, allowedarch in ipairs(allowedarchs) do + local p = project.extraconf("allowedarchs", allowedarch, "plat") + if p == plat then + table.insert(allowedarchs_current, allowedarch) + end + end + local allowedarchs_set = hashset.from(allowedarchs_current) if not allowedarchs_set:has(arch) then - local allowedarchs_str = table.concat(allowedarchs, ", ") + local allowedarchs_str = table.concat(allowedarchs_current, ", ") raise("`%s` is not a valid complation arch for this project, please use one of %s", arch, allowedarchs_str) end end diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 5bda50f05..ea66f2bb6 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -657,6 +657,8 @@ function project.apis() , "add_requires" , "add_requireconfs" , "add_repositories" + , "add_allowedmodes" + , "add_allowedarchs" } , paths = { |
