[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70031] [core-updates PATCH 02/19] build-system/cmake: Parameterize
From: |
Greg Hogan |
Subject: |
[bug#70031] [core-updates PATCH 02/19] build-system/cmake: Parameterize build system generator. |
Date: |
Wed, 27 Mar 2024 14:52:27 +0000 |
* guix/build-system/cmake.scm (cmake-build): Add generator parameter
defaulted to the default CMake build system generator.
* guix/build/cmake-build-system.scm (configure): Add and use generator
parameter to configure the build system.
* doc/guix.texi (Build Systems): Document #:generator for
cmake-build-system.
---
doc/guix.texi | 4 ++++
guix/build-system/cmake.scm | 4 ++++
guix/build/cmake-build-system.scm | 5 ++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index ddd98a5fd46..782893b4f23 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9623,6 +9623,10 @@ Build Systems
it defaults to @code{"RelWithDebInfo"} (short for ``release mode with
debugging information''), which roughly means that code is compiled with
@code{-O2 -g}, as is the case for Autoconf-based packages by default.
+The @code{#:generator} parameter configures the native build system; it
+defaults to @code{"Unix Makefiles"} and can be changed to an alternative
+such as @code{Ninja} (the alternative generator must be available as
+both a module and native input).
@end defvar
@defvar composer-build-system
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index aa187c9844b..a4d69276748 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -101,6 +101,7 @@ (define* (cmake-build name inputs
(search-paths '())
(make-flags ''())
(out-of-source? #t)
+ (generator "Unix Makefiles")
(build-type "RelWithDebInfo")
(tests? #t)
(test-target "test")
@@ -140,6 +141,7 @@ (define* (cmake-build name inputs
configure-flags)
#:make-flags #$make-flags
#:out-of-source? #$out-of-source?
+ #:generator #$generator
#:build-type #$build-type
#:tests? #$tests?
#:test-target #$test-target
@@ -177,6 +179,7 @@ (define* (cmake-cross-build name
(native-search-paths '())
(make-flags ''())
(out-of-source? #t)
+ (generator "Unix Makefiles")
(build-type "RelWithDebInfo")
(tests? #f) ; nothing can be done
(test-target "test")
@@ -231,6 +234,7 @@ (define* (cmake-cross-build name
#:configure-flags #$configure-flags
#:make-flags #$make-flags
#:out-of-source? #$out-of-source?
+ #:generator #$generator
#:build-type #$build-type
#:tests? #$tests?
#:test-target #$test-target
diff --git a/guix/build/cmake-build-system.scm
b/guix/build/cmake-build-system.scm
index ea342ff2ac9..1775f7a7509 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -34,7 +34,7 @@ (define-module (guix build cmake-build-system)
;; Code:
(define* (configure #:key outputs (configure-flags '()) (out-of-source? #t)
- build-type target
+ build-type target generator
#:allow-other-keys)
"Configure the given package."
(let* ((out (assoc-ref outputs "out"))
@@ -50,6 +50,9 @@ (define* (configure #:key outputs (configure-flags '())
(out-of-source? #t)
(format #t "build directory: ~s~%" (getcwd))
(let ((args `(,srcdir
+ ,@(if generator
+ (list (string-append "-G" generator))
+ '())
,@(if build-type
(list (string-append "-DCMAKE_BUILD_TYPE="
build-type))
--
2.44.0
- [bug#70031] [core-updates PATCH 00/19] Use CMake in build-system/cmake., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 03/19] build-system/cmake: Add build., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 01/19] build-system/cmake: Parallelize tests using ctest., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 04/19] build-system/cmake: Add install., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 05/19] gnu: libmedfile: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 07/19] gnu: fish: Fix tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 09/19] gnu: igraph: Move test target to check phase., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 02/19] build-system/cmake: Parameterize build system generator.,
Greg Hogan <=
- [bug#70031] [core-updates PATCH 06/19] gnu: srt: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 10/19] gnu: inkscape: Move test target to check phase., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 11/19] gnu: vigra: Move test target to check phase., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 15/19] gnu: websocketpp: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 12/19] gnu: cpp-httplib: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 14/19] gnu: astroid: Remove custom phases., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 13/19] gnu: libical: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 08/19] gnu: vulkan-loader: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 16/19] gnu: mbedtls-lts: Disable parallel tests., Greg Hogan, 2024/03/27
- [bug#70031] [core-updates PATCH 18/19] gnu: evolution-data-server: Disable parallel tests., Greg Hogan, 2024/03/27