diff options
| author | Nicolás Bértolo | 2020-05-13 16:22:17 -0300 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-23 09:36:52 +0100 |
| commit | d59607b68592fa709bd8466a3ac7300d280df83a (patch) | |
| tree | 2046c972d4d6e65a7056db8bc79990542f508d4c | |
| parent | 60b326ef112b6196cccf8bf9508df9e6622285cb (diff) | |
| download | emacs-d59607b68592fa709bd8466a3ac7300d280df83a.tar.gz emacs-d59607b68592fa709bd8466a3ac7300d280df83a.zip | |
* Windows: Use NUMBER_OF_PROCESSORS environment variable.
* lisp/emacs-lisp/comp.el (comp-effective-async-max-jobs): Use
NUMBER_OF_PROCESSORS environment variable if system is Windows NT,
"nproc" if it is in PATH or a default of 1.
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index e5d3be6eed0..6c152136fb5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -2302,9 +2302,14 @@ processes from `comp-async-compilations'" | |||
| 2302 | (if (zerop comp-async-jobs-number) | 2302 | (if (zerop comp-async-jobs-number) |
| 2303 | (or comp-num-cpus | 2303 | (or comp-num-cpus |
| 2304 | (setf comp-num-cpus | 2304 | (setf comp-num-cpus |
| 2305 | ;; Half of the CPUs or at least one. | 2305 | ;; FIXME: we already have a function to determine |
| 2306 | ;; FIXME portable? | 2306 | ;; the number of processors, see get_native_system_info in w32.c. |
| 2307 | (max 1 (/ (string-to-number (shell-command-to-string "nproc")) | 2307 | ;; The result needs to be exported to Lisp. |
| 2308 | (max 1 (/ (cond ((eq 'windows-nt system-type) | ||
| 2309 | (string-to-number (getenv "NUMBER_OF_PROCESSORS"))) | ||
| 2310 | ((executable-find "nproc") | ||
| 2311 | (string-to-number (shell-command-to-string "nproc"))) | ||
| 2312 | (t 1)) | ||
| 2308 | 2)))) | 2313 | 2)))) |
| 2309 | comp-async-jobs-number)) | 2314 | comp-async-jobs-number)) |
| 2310 | 2315 | ||