summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-03 23:11:45 +0800
committerGitHub <[email protected]>2022-09-03 23:11:45 +0800
commit900b749ec6ada339f06ce025f81642f33a6d05d6 (patch)
treeef88dc44cbf5cab9de79132c16f31ac6a601f859
parent195c3d29e6ea0145c920393cbb0cf1598c1e80f0 (diff)
parentb65703e6b570c00629f8f2431ca329c286290c9c (diff)
Merge pull request #2773 from noeffn/noeffn-vcpkg-freebsd
fixes freebsd platform triplet name
-rw-r--r--xmake/modules/package/manager/vcpkg/configurations.lua9
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua5
-rw-r--r--xmake/modules/package/manager/vcpkg/install_package.lua8
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