summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-10 22:29:23 +0800
committerruki <[email protected]>2023-01-10 22:29:23 +0800
commit17af8e37083e8db235536de17a9f8762502e1ca5 (patch)
tree70cae568b70e6e451637c57a696421806b439a9e
parent5cb6e80bc887ed89a34d101e3080c4d9c087d8d0 (diff)
improve vsxmake generator #3268
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua11
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua11
2 files changed, 18 insertions, 4 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index 4c4f2a8e4..3ba257720 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -477,8 +477,15 @@ function _make_vsinfo_archs()
end
if default_archs then
default_archs = hashset.from(table.wrap(default_archs))
- default_archs:remove("arm64")
- vsinfo_archs = default_archs:to_array()
+ -- just generate single arch by default to avoid some fails for installing packages.
+ -- @see https://github.com/xmake-io/xmake/issues/3268
+ local arch = config.arch()
+ if default_archs:has(arch) then
+ vsinfo_archs = { arch }
+ else
+ default_archs:remove("arm64")
+ vsinfo_archs = default_archs:to_array()
+ end
end
end
end
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 59ad0ce02..9afe6f624 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -263,8 +263,15 @@ function _make_vsinfo_archs()
end
if default_archs then
default_archs = hashset.from(table.wrap(default_archs))
- default_archs:remove("arm64")
- vsinfo_archs = default_archs:to_array()
+ -- just generate single arch by default to avoid some fails for installing packages.
+ -- @see https://github.com/xmake-io/xmake/issues/3268
+ local arch = config.arch()
+ if default_archs:has(arch) then
+ vsinfo_archs = { arch }
+ else
+ default_archs:remove("arm64")
+ vsinfo_archs = default_archs:to_array()
+ end
end
end
end