automatically parallelize C/C++ cmake builds

This commit is contained in:
2024-01-19 10:18:46 +01:00
parent e6d452cac2
commit b33d4e4545

8
.emacs
View File

@@ -126,6 +126,10 @@
;; Enable recursive minibuffers
(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
:project-file "CMakeLists.txt"
:configure "cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On"
:compile "cmake --build build"
:test "cmake --build build --target check"
:compile (format "cmake --build build -j %d" atu/numprocs)
:test (format "cmake --build build -j %d --target check" atu/numprocs)
:related-files-fn
(list
#'atu/cc-related-files