summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorfallen ink <[email protected]>2021-04-28 10:33:56 +0800
committerfallen ink <[email protected]>2021-04-28 10:33:56 +0800
commita01adb5915ba8d370267edf02a2a7559ab628c19 (patch)
tree08a3c3da0455e93b464d27f0e998852b8cbd96ca /xmake/modules
parentd0ef3fca402b5a361ad48520c57b074fcb99b565 (diff)
[DEV] add more plats,archs mapping for vcpkg
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua15
-rw-r--r--xmake/modules/package/manager/vcpkg/install_package.lua15
2 files changed, 30 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index f9579fd66..b3466ad94 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -79,11 +79,26 @@ 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
+
+ -- mapping arch
if arch == "x86_64" then
arch = "x64"
+ elseif arch == "i386" then
+ arch = "x86"
+ -- android: armeabi armeabi-v7a arm64-v8a x86 x86_64 mips mip64
+ -- vcpkg triplets not support plat_android, but offers a doc: https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
+ elseif arch == "arm64-v8a" then
+ arch = "arm64"
+ elseif arch == "armeabi-v7a" then
+ arch = "arm"
+ -- ios: arm64 armv7 armv7s i386
+ elseif arch == "armv7" or arch == "armv7s" then
+ arch = "arm"
end
-- get the vcpkg installed directory
diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua
index d44c6e849..115493b35 100644
--- a/xmake/modules/package/manager/vcpkg/install_package.lua
+++ b/xmake/modules/package/manager/vcpkg/install_package.lua
@@ -41,11 +41,26 @@ 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
+
+ -- mapping arch
if arch == "x86_64" then
arch = "x64"
+ elseif arch == "i386" then
+ arch = "x86"
+ -- android: armeabi armeabi-v7a arm64-v8a x86 x86_64 mips mip64
+ -- vcpkg triplets not support plat_android, but offers a doc: https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
+ elseif arch == "arm64-v8a" then
+ arch = "arm64"
+ elseif arch == "armeabi-v7a" then
+ arch = "arm"
+ -- ios: arm64 armv7 armv7s i386
+ elseif arch == "armv7" or arch == "armv7s" then
+ arch = "arm"
end
-- init triplet