automatically parallelize C/C++ cmake builds
This commit is contained in:
8
.emacs
8
.emacs
@@ -126,6 +126,10 @@
|
|||||||
|
|
||||||
;; Enable recursive minibuffers
|
;; Enable recursive minibuffers
|
||||||
(setq enable-recursive-minibuffers t)
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
|
(defconst atu/numprocs
|
||||||
|
(string-to-number (shell-command-to-string "nproc"))
|
||||||
|
"The number of processor on the system")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -630,8 +634,8 @@
|
|||||||
(projectile-register-project-type 'cmake-cc #'atu/cmake-cc-inference
|
(projectile-register-project-type 'cmake-cc #'atu/cmake-cc-inference
|
||||||
:project-file "CMakeLists.txt"
|
:project-file "CMakeLists.txt"
|
||||||
:configure "cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On"
|
:configure "cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On"
|
||||||
:compile "cmake --build build"
|
:compile (format "cmake --build build -j %d" atu/numprocs)
|
||||||
:test "cmake --build build --target check"
|
:test (format "cmake --build build -j %d --target check" atu/numprocs)
|
||||||
:related-files-fn
|
:related-files-fn
|
||||||
(list
|
(list
|
||||||
#'atu/cc-related-files
|
#'atu/cc-related-files
|
||||||
|
|||||||
Reference in New Issue
Block a user