guix_mirror_bot pushed a commit to branch c++-team
in repository guix.
commit 3cd05936ea0797a49ae7d1ad0b6c8f429169e0b9
Author: Dariqq <[email protected]>
AuthorDate: Wed Jul 9 08:57:19 2025 +0000
build-system: cmake: Add cmake-system-processor-for-target.
* guix/build-system/cmake.scm (cmake-system-processor-for-target): New
procedure.
Change-Id: I98277ed07c09bd41495782179494865c4c8458e8
Signed-off-by: Greg Hogan <[email protected]>
---
guix/build-system/cmake.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 0e6cbdcd7f..724d24a210 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -54,6 +54,22 @@
;; For avr, or1k-elf, xtensa-ath9k-elf
(_ "Generic")))
+(define* (cmake-system-processor-for-target
+ #:optional (target (or (%current-target-system)
+ (%current-system))))
+ (match target
+ ((? target-x86-32?) (substring target 0 4))
+ ((? target-x86-64?) "x86_64")
+ ((? target-arm32?) "armv7")
+ ((? target-aarch64?) "aarch64")
+ ((? target-loongarch64?) "loongarch64")
+ ((? target-ppc64le?) "ppc64le")
+ ((? target-ppc32?) "ppc")
+ ((? target-riscv64?) "riscv64")
+ ((? target-mips64el?) "mips64el")
+ ((? target-avr?) "avr")
+ (_ (car (string-split target #\-)))))
+
(define %cmake-build-system-modules
;; Build-side modules imported by default.
`((guix build cmake-build-system)