diff options
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/configurations.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 5 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 8 |
3 files changed, 13 insertions, 9 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..25893c2f3 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -73,9 +73,8 @@ 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 + + plat = configurations.plat(plat) arch = configurations.arch(arch) -- get the vcpkg info directories diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index 27d4a1d65..13d9809de 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -47,9 +47,7 @@ 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 + plat = configurations.plat(plat) arch = configurations.arch(arch) -- init triplet @@ -80,9 +78,7 @@ function _install_for_manifest(vcpkg, name, opt) -- init triplet local arch = opt.arch local plat = opt.plat - if plat == "macosx" then - plat = "osx" - end + plat = configurations.plat(plat) arch = configurations.arch(arch) local triplet = arch .. "-" .. plat if opt.plat == "windows" and configs.shared ~= true then |
