diff options
| author | Bai Miao <[email protected]> | 2024-07-22 14:04:30 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-22 14:04:30 +0800 |
| commit | d1a24ae84939672ef3c76b6943daeca469e43416 (patch) | |
| tree | 6e3201e8d8190128c1dcc86db63b1af75f71f5a9 | |
| parent | d3f4cf3871782744ebbcb0898a0c5df69d924b15 (diff) | |
revert msbuild.lua
| -rw-r--r-- | xmake/modules/private/action/trybuild/msbuild.lua | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/xmake/modules/private/action/trybuild/msbuild.lua b/xmake/modules/private/action/trybuild/msbuild.lua index 1df12347d..d8e1f1baa 100644 --- a/xmake/modules/private/action/trybuild/msbuild.lua +++ b/xmake/modules/private/action/trybuild/msbuild.lua @@ -21,7 +21,6 @@ -- imports import("core.base.option") import("core.project.config") -import("core.project.project") import("core.tool.toolchain") import("lib.detect.find_file") import("lib.detect.find_tool") @@ -43,12 +42,11 @@ function clean() local projectfile = _find_projectfile() local runenvs = toolchain.load("msvc"):runenvs() local msbuild = find_tool("msbuild", {envs = runenvs}) - local platform = is_arch("x64") and "x64" or "Win32" local projectdata = io.readfile(projectfile) if projectdata and projectdata:find("Any CPU", 1, true) then platform = "Any CPU" end - os.vexecv(msbuild.program, {projectfile, "-nologo", "-t:Clean", "-p:Configuration=" .. (is_mode("debug") and "Debug" or "Release"), "-p:Platform=" .. platform}, {envs = runenvs}) + os.vexecv(msbuild.program, {projectfile, "-nologo", "-t:Clean", "-p:Configuration=Release", "-p:Platform=" .. platform}, {envs = runenvs}) end -- do build @@ -66,14 +64,6 @@ function build() if projectdata and projectdata:find("Any CPU", 1, true) then platform = "Any CPU" end - local configs = {projectfile, "-nologo", "-t:Build", "-p:Configuration=" .. (is_mode("debug") and "Debug" or "Release"), "-p:Platform=" .. platform} - local jobs = option.get("jobs") or tostring(os.default_njob()) - table.insert(configs, (jobs ~= nil and format("-m:%d", jobs) or "-m")) - if jobs and project.policy("package.msbuild.multi_tool_task") then - table.insert(configs, "/p:UseMultiToolTask=true") - table.insert(configs, "/p:EnforceProcessCountAcrossBuilds=true") - table.insert(configs, format("/p:MultiProcMaxCount=%d", jobs)) - end - os.vexecv(msbuild.program, configs, {envs = runenvs}) + os.vexecv(msbuild.program, {projectfile, "-nologo", "-t:Build", "-p:Configuration=Release", "-p:Platform=" .. platform}, {envs = runenvs}) cprint("${color.success}build ok!") end |
