summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-05-09 17:13:54 +0800
committerruki <[email protected]>2020-05-09 17:13:54 +0800
commitc9eacb29c8b3d067e6a64f8eb23c0ef5043d7b5c (patch)
treec04fdbb59a482b48de00d682eb08c61920819b18
parentd86db607b163a594909059741a8e00f9d0fd8a0f (diff)
improve vcpkg
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua4
-rw-r--r--xmake/modules/package/manager/vcpkg/install_package.lua3
2 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index 78e4ff335..2dbf51cfe 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -57,8 +57,10 @@ function main(name, opt)
-- find the package info file, e.g. zlib_1.2.11-3_x86-windows[-static].list
local triplet = arch .. "-" .. plat
- if plat == "windows" and opt.pkgconfigs and opt.pkgconfigs.vs_runtime == "MT" then
+ 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!")
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 c46ec6723..60e06e7fa 100644
--- a/xmake/modules/package/manager/vcpkg/install_package.lua
+++ b/xmake/modules/package/manager/vcpkg/install_package.lua
@@ -50,8 +50,9 @@ function main(name, opt)
-- init triplet
local triplet = arch .. "-" .. plat
- if opt.plat == "windows" and opt.vs_runtime == "MT" then
+ 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!")
end
-- init argv