浏览代码

improve compilation jobs for boost (#2025)

* improve compilation jobs for boost

* Update xmake.lua

---------

Co-authored-by: ruki <[email protected]>
wanzzhehe 2 年之前
父节点
当前提交
e82b8edd15
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/b/boost/xmake.lua

+ 3 - 1
packages/b/boost/xmake.lua

@@ -128,6 +128,7 @@ package("boost")
     end)
 
     on_install("macosx", "linux", "windows", "bsd", "mingw", "cross", function (package)
+        import("core.base.option")
 
         -- force boost to compile with the desired compiler
         local file = io.open("user-config.jam", "a")
@@ -170,12 +171,13 @@ package("boost")
         end
         os.vrun("./b2 headers")
 
+        local njobs = option.get("jobs") or tostring(os.default_njob())
         local argv =
         {
             "--prefix=" .. package:installdir(),
             "--libdir=" .. package:installdir("lib"),
             "-d2",
-            "-j4",
+            "-j" .. njobs,
             "--hash",
             "--layout=tagged-1.66", -- prevent -x64 suffix in case cmake can't find it
             "--user-config=user-config.jam",