diff options
| author | ruki <[email protected]> | 2016-01-06 10:21:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-01-06 10:21:39 +0800 |
| commit | b883a25c05116468adcc9e6d6c4cd69afb28e253 (patch) | |
| tree | 55fa10b35410c715ed788427800b9edeafa5dec3 /xmake/scripts/tools/make.lua | |
| parent | 0a77bcb2dd1ea4e6ade9b95befc3a2f008702c79 (diff) | |
add --jobs arguments
Diffstat (limited to 'xmake/scripts/tools/make.lua')
| -rw-r--r-- | xmake/scripts/tools/make.lua | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/xmake/scripts/tools/make.lua b/xmake/scripts/tools/make.lua index b16d4880c..5d2d1f42b 100644 --- a/xmake/scripts/tools/make.lua +++ b/xmake/scripts/tools/make.lua @@ -41,19 +41,29 @@ end -- the main function function make.main(self, mkfile, target) + -- enable jobs? + local jobs = "" + if xmake._OPTIONS.jobs ~= nil then + if tonumber(xmake._OPTIONS.jobs) ~= 0 then + jobs = "-j" .. xmake._OPTIONS.jobs + else + jobs = "-j" + end + end + -- make command local cmd = nil if mkfile and os.isfile(mkfile) then - cmd = string.format("%s -r -j4 -f %s %s VERBOSE=%s", self.name, mkfile, target or "", self._VERBOSE) + cmd = string.format("%s -r %s -f %s %s VERBOSE=%s", self.name, jobs, mkfile, target or "", self._VERBOSE) else - cmd = string.format("%s -r -j4 %s VERBOSE=%s", self.name, target or "", self._VERBOSE) + cmd = string.format("%s -r %s %s VERBOSE=%s", self.name, jobs, target or "", self._VERBOSE) end -- done local ok = os.execute(cmd) if ok ~= 0 then - -- attempt to execute it again for getting the error logs without -j4 + -- attempt to execute it again for getting the error logs without jobs if mkfile and os.isfile(mkfile) then cmd = string.format("%s -r -f %s %s VERBOSE=%s", self.name, mkfile, target or "", self._VERBOSE) else |
