From a01adb5915ba8d370267edf02a2a7559ab628c19 Mon Sep 17 00:00:00 2001 From: fallen ink Date: Wed, 28 Apr 2021 10:33:56 +0800 Subject: [DEV] add more plats,archs mapping for vcpkg --- xmake/modules/package/manager/vcpkg/find_package.lua | 15 +++++++++++++++ xmake/modules/package/manager/vcpkg/install_package.lua | 15 +++++++++++++++ 2 files changed, 30 insertions(+) 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 -- cgit v1.3.1