guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#70031] [PATCH v2 05/65] build-system/cmake: Add build.


From: Greg Hogan
Subject: [bug#70031] [PATCH v2 05/65] build-system/cmake: Add build.
Date: Tue, 22 Oct 2024 18:08:55 +0000

* 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 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/build/cmake-build-system.scm 
b/guix/build/cmake-build-system.scm
index 3fab010c85..d827be1806 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -82,6 +82,15 @@ (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)))
+                 ;; When unset CMake defers to the build system.
+                 '("-j" "1")))))
+
 (define %test-suite-log-regexp
   ;; Name of test suite log files as commonly found in CMake.
   "^LastTest\\.log$")
@@ -104,10 +113,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)))
 
-- 
2.46.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]