diff options
| author | ruki <[email protected]> | 2020-10-20 00:47:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-20 00:47:43 +0800 |
| commit | 74bbd076116a9d199f607bd9986e485973079787 (patch) | |
| tree | 43340041358e4abd052c2494cbe14cbc770d3321 | |
| parent | fe0e074ff21fee5dd16e66c3b52a389cea8b08e4 (diff) | |
improve to install vcpkg
| -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) |
