diff options
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/configurations.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 14 |
3 files changed, 16 insertions, 14 deletions
diff --git a/xmake/modules/package/manager/vcpkg/configurations.lua b/xmake/modules/package/manager/vcpkg/configurations.lua index fccde8d92..0a03f4d35 100644 --- a/xmake/modules/package/manager/vcpkg/configurations.lua +++ b/xmake/modules/package/manager/vcpkg/configurations.lua @@ -37,6 +37,15 @@ function arch(arch) return archs[arch] or arch end +-- get platform for vcpkg +function plat(plat) + local plats = { + macosx = "osx", + bsd = "freebsd", + } + return plats[plat] or plat +end + -- get configurations function main() return { diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index b15844ede..0dc95bd0f 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -73,10 +73,9 @@ function _find_package(vcpkgdir, name, opt) local arch = opt.arch local plat = opt.plat local mode = opt.mode - if plat == "macosx" then - plat = "osx" - end - arch = configurations.arch(arch) + + plat = configurations.plat(plat) + arch = configurations.arch(arch) -- get the vcpkg info directories local infodirs = {} diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index cb7093943..3fdff9bca 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -47,10 +47,8 @@ function _install_for_classic(vcpkg, name, opt) local arch = opt.arch local plat = opt.plat local mode = opt.mode - if plat == "macosx" then - plat = "osx" - end - arch = configurations.arch(arch) + plat = configurations.plat(plat) + arch = configurations.arch(arch) -- init triplet local triplet = arch .. "-" .. plat @@ -80,12 +78,8 @@ function _install_for_manifest(vcpkg, name, opt) -- init triplet local arch = opt.arch local plat = opt.plat - if plat == "macosx" then - plat = "osx" - elseif plat == "bsd" then - plat = "freebsd" - end - arch = configurations.arch(arch) + plat = configurations.plat(plat) + arch = configurations.arch(arch) local triplet = arch .. "-" .. plat if opt.plat == "windows" and configs.shared ~= true then triplet = triplet .. "-static" |
