summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBai Miao <[email protected]>2024-07-22 14:08:13 +0800
committerGitHub <[email protected]>2024-07-22 14:08:13 +0800
commiteb976c3a690f4eebcb79dc4492b830c5bf7830e9 (patch)
tree03e069181f8241d629f1c4ed89320ad13d968b73
parentd1a24ae84939672ef3c76b6943daeca469e43416 (diff)
revert cmake.lua
-rw-r--r--xmake/modules/private/action/trybuild/cmake.lua15
1 files changed, 3 insertions, 12 deletions
diff --git a/xmake/modules/private/action/trybuild/cmake.lua b/xmake/modules/private/action/trybuild/cmake.lua
index c6caa6d65..747ab9c94 100644
--- a/xmake/modules/private/action/trybuild/cmake.lua
+++ b/xmake/modules/private/action/trybuild/cmake.lua
@@ -21,7 +21,6 @@
-- imports
import("core.base.option")
import("core.project.config")
-import("core.project.project")
import("core.tool.toolchain")
import("core.platform.platform")
import("lib.detect.find_file")
@@ -468,17 +467,9 @@ function _build_for_msvc(opt)
local runenvs = _get_msvc_runenvs()
local msbuild = find_tool("msbuild", {envs = runenvs})
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
- local jobs = option.get("jobs") or tostring(os.default_njob())
- local configs = {
- slnfile, "-nologo", "-t:Build", (jobs ~= nil and format("-m:%d", jobs) or "-m"),
- "-p:Configuration=" .. (is_mode("debug") and "Debug" or "Release"),"-p:Platform=" .. _get_vsarch()
- }
- 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, {slnfile, "-nologo", "-t:Build", "-m",
+ "-p:Configuration=" .. (is_mode("debug") and "Debug" or "Release"),
+ "-p:Platform=" .. _get_vsarch()}, {envs = runenvs})
local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj"
if os.isfile(projfile) then
os.vexecv(msbuild.program, {projfile, "/property:configuration=" .. (is_mode("debug") and "Debug" or "Release")}, {envs = runenvs})