]> git.eshelyaron.com Git - emacs.git/commitdiff
propagate compiler settings to the async workers
authorAndrea Corallo <akrl@sdf.org>
Mon, 11 Nov 2019 06:42:01 +0000 (07:42 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:03 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index a31a82dd4f1830c6cc6d974db9b0a7496ff6d7d4..99243fda2c7aa7b1d5d9c4c4f9a5c40498302edd 100644 (file)
@@ -44,7 +44,7 @@
 - 1 lite optimizations.
 - 2 heavy optimizations.
 - 3 max optimization level, to be used only when necessary.
-    The compiler can inline within the compilation unit..."
+    Warning: the compiler is free to perform dangerous optimizations."
   :type 'number
   :group 'comp)
 
@@ -1778,8 +1778,12 @@ Prepare every function for final compilation and drive the C back-end."
        (while (setf f (with-mutex comp-src-pool-mutex
                         (pop comp-src-pool)))
          (when (comp-to-file-p f)
-           (let* ((cmd (concat "emacs --batch --eval="
-                               "'(native-compile \"" f "\")'"))
+           (let* ((code `(let ((comp-speed ,comp-speed)
+                               (comp-debug ,comp-debug)
+                               (comp-verbose ,comp-verbose))
+                           (native-compile ,f)))
+                  (cmd (concat "emacs --batch --eval='"
+                               (prin1-to-string code) "'"))
                   (prc (start-process-shell-command (concat "async compilation: " f)
                                                     "async-compile-buffer"
                                                     cmd)))