From cdef709ef327f2d3546ff89f6bd4b243e951767a Mon Sep 17 00:00:00 2001 From: Dariqq Date: Wed, 9 Jul 2025 08:57:19 +0000 Subject: [PATCH] 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 --- 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)