Extract CPU counting to doom-num-cpus function
And improves macOS support as discussed in hlissner/doom-emacs@db6a27c
This commit is contained in:
parent
b49c40bbb3
commit
b91a1b3e7b
3 changed files with 22 additions and 13 deletions
|
@ -294,12 +294,9 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
|
|||
ccls-sem-highlight-method (if lsp-enable-semantic-highlighting
|
||||
ccls-sem-highlight-method))
|
||||
(when (or IS-MAC IS-LINUX)
|
||||
(let ((cpu-count-command (cond (IS-MAC '("sysctl" "-n" "hw.ncpu"))
|
||||
(IS-LINUX '("nproc"))
|
||||
(t (error "unreachable code")))))
|
||||
(setq ccls-initialization-options
|
||||
`(:index (:trackDependency 1
|
||||
:threads ,(max 1 (/ (string-to-number (cdr (apply #'doom-call-process cpu-count-command))) 2)))))))
|
||||
(setq ccls-initialization-options
|
||||
`(:index (:trackDependency 1
|
||||
:threads ,(max 1 (/ (doom-num-cpus) 2))))))
|
||||
(when IS-MAC
|
||||
(setq ccls-initialization-options
|
||||
(append ccls-initialization-options
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue