summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-20 00:47:43 +0800
committerruki <[email protected]>2020-10-20 00:47:43 +0800
commit74bbd076116a9d199f607bd9986e485973079787 (patch)
tree43340041358e4abd052c2494cbe14cbc770d3321 /xmake/modules
parentfe0e074ff21fee5dd16e66c3b52a389cea8b08e4 (diff)
improve to install vcpkg
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua4
-rw-r--r--xmake/modules/package/manager/vcpkg/install_package.lua7
2 files changed, 9 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index 85b816b8b..1296e9330 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -64,7 +64,9 @@ function main(name, opt)
local pkgconfigs = opt.pkgconfigs
if plat == "windows" and pkgconfigs and pkgconfigs.shared ~= true then
triplet = triplet .. "-static"
- assert(not pkgconfigs.vs_runtime or pkgconfigs.vs_runtime:startswith("MT"), "only support static libraries with /MT[d] for vcpkg!")
+ if pkgconfigs.vs_runtime and pkgconfigs.vs_runtime:startswith("MD") then
+ triplet = triplet .. "-md"
+ end
end
local infofile = find_file(format("%s_*_%s.list", name, triplet), infodir)
diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua
index a65332292..d04602a25 100644
--- a/xmake/modules/package/manager/vcpkg/install_package.lua
+++ b/xmake/modules/package/manager/vcpkg/install_package.lua
@@ -52,11 +52,16 @@ function main(name, opt)
local triplet = arch .. "-" .. plat
if opt.plat == "windows" and opt.shared ~= true then
triplet = triplet .. "-static"
- assert(not opt.vs_runtime or opt.vs_runtime:startswith("MT"), "only support static libraries with /MT[d] for vcpkg!")
+ if opt.vs_runtime and opt.vs_runtime:startswith("MD") then
+ triplet = triplet .. "-md"
+ end
end
-- init argv
local argv = {"install", name .. ":" .. triplet}
+ if option.get("diagnosis") then
+ table.insert(argv, "--debug")
+ end
-- install package
os.vrunv(path.join(vcpkgdir, "vcpkg"), argv)