summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDariqq <dariqq@posteo.net>2025-07-09 08:57:19 +0000
committerAndreas Enge <andreas@enge.fr>2026-02-10 17:33:14 +0100
commitcdef709ef327f2d3546ff89f6bd4b243e951767a (patch)
tree3d37b63b4fc475a278b2a12b2bc941d4f30b619e
parenta1c5edf0163422c1f0eb56d7778f66a9cb2ec10d (diff)
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 <code@greghogan.com>
-rw-r--r--guix/build-system/cmake.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 0e6cbdcd7f2..724d24a210a 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)