diff options
| author | ruki <[email protected]> | 2021-04-29 17:47:14 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-29 17:47:14 +0800 |
| commit | 7bfe1e61d4ee3f8b2878b1a442a75614a8d9ca9e (patch) | |
| tree | a5111807297e6ac751dbd999ab6c708c54df57e3 | |
| parent | 86a73ca5e5fe97e37f59516956b73d64c03f2802 (diff) | |
| parent | df6ca9ee326a838259e709804a403e0c2a2a8f51 (diff) | |
Merge pull request #1369 from maketea-tech/master
[vcpkg] add more plats, archs for vcpkg
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 23 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 23 |
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 |
