mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 20:27:36 -05:00
gexp: 'compiled-modules' defaults to '-O1'.
* guix/gexp.scm (compiled-modules): Add #:optimization-level. [build](optimizations-for-level): New variable. (process-entry): Use it.
This commit is contained in:
parent
3c6113a594
commit
331a09654e
1 changed files with 12 additions and 2 deletions
|
@ -1507,7 +1507,8 @@ (define* (compiled-modules modules
|
|||
(guile (%guile-for-build))
|
||||
(module-path %load-path)
|
||||
(extensions '())
|
||||
(deprecation-warnings #f))
|
||||
(deprecation-warnings #f)
|
||||
(optimization-level 1))
|
||||
"Return a derivation that builds a tree containing the `.go' files
|
||||
corresponding to MODULES. All the MODULES are built in a context where
|
||||
they can refer to each other. When TARGET is true, cross-compile MODULES for
|
||||
|
@ -1531,6 +1532,13 @@ (define build
|
|||
(system base target)
|
||||
(system base compile))
|
||||
|
||||
(define optimizations-for-level
|
||||
(or (and=> (false-if-exception
|
||||
(resolve-interface '(system base optimize)))
|
||||
(lambda (iface)
|
||||
(module-ref iface 'optimizations-for-level))) ;Guile 3.0
|
||||
(const '())))
|
||||
|
||||
(define (regular? file)
|
||||
(not (member file '("." ".."))))
|
||||
|
||||
|
@ -1551,7 +1559,9 @@ (define (process-entry entry output processed)
|
|||
(compile-file entry
|
||||
#:output-file output
|
||||
#:opts
|
||||
%auto-compilation-options)))
|
||||
`(,@%auto-compilation-options
|
||||
,@(optimizations-for-level
|
||||
(ungexp optimization-level))))))
|
||||
|
||||
(+ 1 processed))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue