summaryrefslogtreecommitdiff
path: root/guix/build/cmake-build-system.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-08-26 15:15:49 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-08-26 15:15:49 +0200
commit72e2815d18ad688b0a16ce3b3efba1172423cec4 (patch)
treeb3d6aa01aec86a7f224e15d97a40b64de4e5cdb8 /guix/build/cmake-build-system.scm
parentc20cd0d24d9b5e8a47b864db9799e0992ffd44b9 (diff)
parent2f837cf7fe100b0584fb02cf8f19d4cfb4e14d88 (diff)
downloadguix-patches-72e2815d18ad688b0a16ce3b3efba1172423cec4.tar
guix-patches-72e2815d18ad688b0a16ce3b3efba1172423cec4.tar.gz
Merge branch 'core-updates'
Diffstat (limited to 'guix/build/cmake-build-system.scm')
-rw-r--r--guix/build/cmake-build-system.scm11
1 files changed, 10 insertions, 1 deletions
diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm
index 27f2b5c872..128ab28fe5 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -32,7 +32,7 @@
;; Code:
(define* (configure #:key outputs (configure-flags '()) (out-of-source? #t)
- build-type
+ build-type target
#:allow-other-keys)
"Configure the given package."
(let* ((out (assoc-ref outputs "out"))
@@ -59,6 +59,15 @@
,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib")
;; enable verbose output from builds
"-DCMAKE_VERBOSE_MAKEFILE=ON"
+
+ ;; Cross-build
+ ,@(if target
+ (list (string-append "-DCMAKE_C_COMPILER="
+ target "-gcc")
+ (if (string-contains target "mingw")
+ "-DCMAKE_SYSTEM_NAME=Windows"
+ "-DCMAKE_SYSTEM_NAME=Linux"))
+ '())
,@configure-flags)))
(format #t "running 'cmake' with arguments ~s~%" args)
(zero? (apply system* "cmake" args)))))