mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-12 14:16:55 -05:00
gnu: cpu-features: Fix cross-compilation.
* gnu/packages/assembly.scm (cpu-features)[arguments]<#:configure-flags>: When cross-compilation, set CMAKE_SYSTEM_PROCESSOR. Change-Id: I8b6f9bdeac66b85ab273f81a320e4b8e0d69b5d0 Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
parent
ff185dc003
commit
e320ed5720
1 changed files with 19 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
||||||
;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
|
;;; Copyright © 2022 Felix Gruber <felgru@posteo.net>
|
||||||
;;; Copyright © 2023 Simon South <simon@simonsouth.net>
|
;;; Copyright © 2023 Simon South <simon@simonsouth.net>
|
||||||
;;; Copyright © 2023 B. Wilson <elaexuotee@wilsonb.com>
|
;;; Copyright © 2023 B. Wilson <elaexuotee@wilsonb.com>
|
||||||
|
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -664,7 +665,24 @@ (define-public cpu-features
|
||||||
#:tests? #f
|
#:tests? #f
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
#~(list "-DBUILD_TESTING=off" ;; XXX: insists on using bundled googletest
|
#~(list "-DBUILD_TESTING=off" ;; XXX: insists on using bundled googletest
|
||||||
"-DBUILD_SHARED_LIBS=ON")))
|
"-DBUILD_SHARED_LIBS=ON"
|
||||||
|
#$@(let ((target (%current-target-system)))
|
||||||
|
(if target
|
||||||
|
(cond ((string-prefix? "arm" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=arm"))
|
||||||
|
((string-prefix? "aarch64" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=aarch64"))
|
||||||
|
((string-prefix? "i686" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=x86"))
|
||||||
|
((string-prefix? "x86_64" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=x86_64"))
|
||||||
|
;; 32-bit and 64-bit
|
||||||
|
((string-prefix? "powerpc" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=powerpc"))
|
||||||
|
((string-prefix? "riscv64" target)
|
||||||
|
'("-DCMAKE_SYSTEM_PROCESSOR=riscv64"))
|
||||||
|
(else '()))
|
||||||
|
'())))))
|
||||||
(home-page "https://github.com/google/cpu_features")
|
(home-page "https://github.com/google/cpu_features")
|
||||||
(synopsis "Cross platform C99 library to get cpu features at runtime")
|
(synopsis "Cross platform C99 library to get cpu features at runtime")
|
||||||
(description
|
(description
|
||||||
|
|
Loading…
Reference in a new issue