diff options
| author | xq114 <[email protected]> | 2021-07-03 10:49:12 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2021-07-03 10:49:12 +0800 |
| commit | 04bd9504444a0eed8ea79595ae2f7dfef5f21a76 (patch) | |
| tree | 3642a73a2009cac500a2db836a952c2e72399d2a /xmake/modules | |
| parent | 60db2397f832af73b7cf72177c11ef57e9f80b6a (diff) | |
respect jobs for cmake/msvc
Diffstat (limited to 'xmake/modules')
| -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" |
