Skip to content

Commit

Permalink
Merge pull request #2773 from noeffn/noeffn-vcpkg-freebsd
Browse files Browse the repository at this point in the history
fixes freebsd platform triplet name
  • Loading branch information
waruqi authored Sep 3, 2022
2 parents 195c3d2 + b65703e commit 900b749
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
9 changes: 9 additions & 0 deletions xmake/modules/package/manager/vcpkg/configurations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions xmake/modules/package/manager/vcpkg/find_package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions xmake/modules/package/manager/vcpkg/install_package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 900b749

Please sign in to comment.