summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxpxz <[email protected]>2023-06-22 09:48:46 +0800
committerGitHub <[email protected]>2023-06-22 09:48:46 +0800
commit0b9bcc44481460b4332ef0103c027ff16e529a76 (patch)
treec3f5cd2fff6f8cb9b29c8f731b1ab184edd6521b
parent960b46e798d5a4977af7e5f0e74b61a59ad61846 (diff)
Update msbuild.lua
-rw-r--r--xmake/modules/package/tools/msbuild.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/package/tools/msbuild.lua b/xmake/modules/package/tools/msbuild.lua
index e3194322e..f9be99707 100644
--- a/xmake/modules/package/tools/msbuild.lua
+++ b/xmake/modules/package/tools/msbuild.lua
@@ -22,13 +22,13 @@
import("core.base.option")
import("core.tool.toolchain")
import("lib.detect.find_tool")
+import("private.utils.upgrade_vsproj")
-- get the number of parallel jobs
function _get_parallel_njobs(opt)
return opt.jobs or option.get("jobs") or tostring(os.default_njob())
end
--- tra
-- get msvc
function _get_msvc(package)
local msvc = toolchain.load("msvc", {plat = package:plat(), arch = package:arch()})
@@ -74,8 +74,6 @@ end
-- build package
function build(package, configs, opt)
-
- -- init options
opt = opt or {}
-- pass configurations
@@ -91,6 +89,14 @@ function build(package, configs, opt)
end
end
+ -- upgrade vs solution file?
+ -- @see https://github.com/xmake-io/xmake/issues/3871
+ if opt.upgrade then
+ for _, value in pairs(opt.upgrade) do
+ upgrade_vsproj.upgrade(value, table.join(opt, {msvc = _get_msvc(package)}))
+ end
+ end
+
-- do build
local envs = opt.envs or buildenvs(package, opt)
local msbuild = find_tool("msbuild", {envs = envs})