diff options
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index f41bf0052..bed52f708 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -518,10 +518,12 @@ end -- do build for msvc function _build_for_msvc(package, configs, opt) + local njob = opt.jobs or option.get("jobs") or nil local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!") local runenvs = _get_msvc_runenvs(package) local msbuild = find_tool("msbuild", {envs = runenvs}) - os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", + os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", + (njob ~= nil and format("-m:%d", njob) or "-m"), "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs}) end @@ -558,10 +560,12 @@ end -- do install for msvc function _install_for_msvc(package, configs, opt) + local njob = opt.jobs or option.get("jobs") or nil local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!") local runenvs = _get_msvc_runenvs(package) local msbuild = assert(find_tool("msbuild", {envs = runenvs}), "msbuild not found!") - os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", + os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", + (njob ~= nil and format("-m:%d", njob) or "-m"), "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs}) local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj" |
