diff mbox series

[bug#70031,core-updates,03/19] build-system/cmake: Add build.

Message ID adaf97000bd461508b11da115413d2055fc00856.1711549374.git.code@greghogan.com
State New
Headers show
Series Use CMake in build-system/cmake. | expand

Commit Message

Greg Hogan March 27, 2024, 2:52 p.m. UTC
* guix/build/cmake-build-system.scm (build): New function to replace
the make build with the cmake build command.
---
 guix/build/cmake-build-system.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm
index 1775f7a7509..8f1c80aeb64 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -81,6 +81,14 @@  (define* (configure #:key outputs (configure-flags '()) (out-of-source? #t)
       (format #t "running 'cmake' with arguments ~s~%" args)
       (apply invoke "cmake" args))))
 
+(define* (build #:key (parallel-build? #t) #:allow-other-keys)
+  (apply invoke "cmake"
+         `("--build"
+           "."
+           ,@(if parallel-build?
+                 `("-j" ,(number->string (parallel-job-count)))
+                 '()))))
+
 (define %test-suite-log-regexp
   ;; Name of test suite log files as commonly found in CMake.
   "^LastTestFailed\\.log$")
@@ -102,10 +110,9 @@  (define* (check #:key (tests? #t) (parallel-tests? #t)
       (format #t "test suite not run~%")))
 
 (define %standard-phases
-  ;; Everything is as with the GNU Build System except for the `configure'
-  ;; and 'check' phases.
   (modify-phases gnu:%standard-phases
     (delete 'bootstrap)
+    (replace 'build build)
     (replace 'check check)
     (replace 'configure configure)))