native-comp-available-p is the definitive test
* doc/lispref/compile.texi (Native Compilation): Document native-comp-available-p as the way to test for native compilation. * lisp/emacs-lisp/package.el (package--native-compile-async): * test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines): Test for native compilation with native-comp-available-p. Thank you to Andrea Corallo for reviewing this patch.
This commit is contained in:
parent
1b383ac424
commit
d86b2e59c7
3 changed files with 3 additions and 5 deletions
|
@ -811,8 +811,7 @@ for you to be able to native-compile Lisp code.
|
||||||
|
|
||||||
@vindex native-compile@r{, a Lisp feature}
|
@vindex native-compile@r{, a Lisp feature}
|
||||||
To determine whether the current Emacs process can produce and load
|
To determine whether the current Emacs process can produce and load
|
||||||
natively-compiled Lisp code, test whether the @code{native-compile}
|
natively-compiled Lisp code, call
|
||||||
feature is available (@pxref{Named Features}). Alternatively, call
|
|
||||||
@code{native-comp-available-p} (@pxref{Native-Compilation Functions}).
|
@code{native-comp-available-p} (@pxref{Native-Compilation Functions}).
|
||||||
|
|
||||||
Unlike byte-compiled code, natively-compiled Lisp code is executed
|
Unlike byte-compiled code, natively-compiled Lisp code is executed
|
||||||
|
|
|
@ -1081,8 +1081,7 @@ This assumes that `pkg-desc' has already been activated with
|
||||||
"Native compile installed package PKG-DESC asynchronously.
|
"Native compile installed package PKG-DESC asynchronously.
|
||||||
This assumes that `pkg-desc' has already been activated with
|
This assumes that `pkg-desc' has already been activated with
|
||||||
`package-activate-1'."
|
`package-activate-1'."
|
||||||
(when (and (featurep 'native-compile)
|
(when (native-comp-available-p)
|
||||||
(native-comp-available-p))
|
|
||||||
(let ((warning-minimum-level :error))
|
(let ((warning-minimum-level :error))
|
||||||
(native-compile-async (package-desc-dir pkg-desc) t))))
|
(native-compile-async (package-desc-dir pkg-desc) t))))
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ As `call-process'' and `file-directory-p' will be redefined, the
|
||||||
native compiler will invoke `call-process' to compile the
|
native compiler will invoke `call-process' to compile the
|
||||||
respective trampolines. To avoid interferences with the
|
respective trampolines. To avoid interferences with the
|
||||||
`call-process' mocking we build these AOT."
|
`call-process' mocking we build these AOT."
|
||||||
(when (featurep 'native-compile)
|
(when (native-comp-available-p)
|
||||||
(mapc #'comp-subr-trampoline-install '(call-process file-directory-p))))
|
(mapc #'comp-subr-trampoline-install '(call-process file-directory-p))))
|
||||||
|
|
||||||
(defun mh-test-utils-setup-with-mocks ()
|
(defun mh-test-utils-setup-with-mocks ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue