diff options
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 7 |
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) |
