From 72e4fc1453ac10299fc2257dd074c70c21865718 Mon Sep 17 00:00:00 2001 From: noeffn Date: Sat, 3 Sep 2022 15:36:10 +0200 Subject: Fixes freebsd platform triplet name --- xmake/modules/package/manager/vcpkg/install_package.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index 27d4a1d65..cb7093943 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -82,6 +82,8 @@ function _install_for_manifest(vcpkg, name, opt) local plat = opt.plat if plat == "macosx" then plat = "osx" + elseif plat == "bsd" then + plat = "freebsd" end arch = configurations.arch(arch) local triplet = arch .. "-" .. plat -- cgit v1.3.1 From 0a524bac87c80e6401caa560f4c0bf8bc16d560a Mon Sep 17 00:00:00 2001 From: noeffn Date: Sat, 3 Sep 2022 16:17:21 +0200 Subject: adds platform mapping for vcpkg --- xmake/modules/package/manager/vcpkg/configurations.lua | 9 +++++++++ xmake/modules/package/manager/vcpkg/find_package.lua | 7 +++---- 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" -- cgit v1.3.1 From b65703e6b570c00629f8f2431ca329c286290c9c Mon Sep 17 00:00:00 2001 From: noeffn Date: Sat, 3 Sep 2022 16:20:14 +0200 Subject: fixes whitespaces --- xmake/modules/package/manager/vcpkg/find_package.lua | 2 +- xmake/modules/package/manager/vcpkg/install_package.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index 0dc95bd0f..25893c2f3 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -75,7 +75,7 @@ function _find_package(vcpkgdir, name, opt) local mode = opt.mode plat = configurations.plat(plat) - arch = configurations.arch(arch) + 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 3fdff9bca..13d9809de 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -48,7 +48,7 @@ function _install_for_classic(vcpkg, name, opt) local plat = opt.plat local mode = opt.mode plat = configurations.plat(plat) - arch = configurations.arch(arch) + arch = configurations.arch(arch) -- init triplet local triplet = arch .. "-" .. plat @@ -79,7 +79,7 @@ function _install_for_manifest(vcpkg, name, opt) local arch = opt.arch local plat = opt.plat plat = configurations.plat(plat) - arch = configurations.arch(arch) + arch = configurations.arch(arch) local triplet = arch .. "-" .. plat if opt.plat == "windows" and configs.shared ~= true then triplet = triplet .. "-static" -- cgit v1.3.1