summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua23
-rw-r--r--xmake/modules/package/manager/vcpkg/install_package.lua23
2 files changed, 40 insertions, 6 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index f9579fd66..34df916af 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -79,12 +79,29 @@ function main(name, opt)
local arch = opt.arch
local plat = opt.plat
local mode = opt.mode
+
+ -- mapping plat
if plat == "macosx" then
plat = "osx"
end
- if arch == "x86_64" then
- arch = "x64"
- end
+
+ -- archs mapping for vcpkg
+ local archs = {
+ x86_64 = "x64",
+ i386 = "x86",
+
+ -- android: armeabi armeabi-v7a arm64-v8a x86 x86_64 mips mip64
+ -- Offers a doc: https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
+ ["armeabi-v7a"] = "arm",
+ ["arm64-v8a"] = "arm64",
+
+ -- ios: arm64 armv7 armv7s i386
+ armv7 = "arm",
+ armv7s = "arm",
+ arm64 = "arm64",
+ }
+ -- mapping arch
+ arch = archs[arch] or arch
-- get the vcpkg installed directory
local installdir = path.join(vcpkgdir, "installed")
diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua
index d44c6e849..eaf28710e 100644
--- a/xmake/modules/package/manager/vcpkg/install_package.lua
+++ b/xmake/modules/package/manager/vcpkg/install_package.lua
@@ -41,12 +41,29 @@ function main(name, opt)
local arch = opt.arch
local plat = opt.plat
local mode = opt.mode
+
+ -- mapping plat
if plat == "macosx" then
plat = "osx"
end
- if arch == "x86_64" then
- arch = "x64"
- end
+
+ -- archs mapping for vcpkg
+ local archs = {
+ x86_64 = "x64",
+ i386 = "x86",
+
+ -- android: armeabi armeabi-v7a arm64-v8a x86 x86_64 mips mip64
+ -- Offers a doc: https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
+ ["armeabi-v7a"] = "arm",
+ ["arm64-v8a"] = "arm64",
+
+ -- ios: arm64 armv7 armv7s i386
+ armv7 = "arm",
+ armv7s = "arm",
+ arm64 = "arm64",
+ }
+ -- mapping arch
+ arch = archs[arch] or arch
-- init triplet
local triplet = arch .. "-" .. plat