Added -no-compiler-subprocess option

This commit is contained in:
Justin Ethier 2021-08-17 05:04:36 -04:00
parent 99ce726ca3
commit 876a93bf39

View file

@ -984,6 +984,7 @@
; args)) ; args))
(compile? #t) (compile? #t)
(run-scm-compiler? (member "-run-scm-compiler" args)) (run-scm-compiler? (member "-run-scm-compiler" args))
(no-compiler-subprocess (member "-no-compiler-subprocess" args))
(cc-prog (apply string-append (collect-opt-values args "-CP"))) (cc-prog (apply string-append (collect-opt-values args "-CP")))
(cc-exec (apply string-append (collect-opt-values args "-CE"))) (cc-exec (apply string-append (collect-opt-values args "-CE")))
(cc-lib (apply string-append (collect-opt-values args "-CL"))) (cc-lib (apply string-append (collect-opt-values args "-CL")))
@ -1133,10 +1134,18 @@ Debug options:
(run-compiler non-opts append-dirs prepend-dirs)) (run-compiler non-opts append-dirs prepend-dirs))
(else (else
;; Generate the C file ;; Generate the C file
(system (cond
(string-append (no-compiler-subprocess
(calling-program) " -run-scm-compiler " ;; Special case, we can generate .C file within this process
(string-join args " "))) (run-compiler non-opts append-dirs prepend-dirs))
(else
;; Normal path is to run another instance of cyclone to generate
;; the .C file. This lets us immediately free those resources once
;; the Scheme compilation is done.
(system
(string-append
(calling-program) " -run-scm-compiler "
(string-join args " ")))))
;; Call the C compiler ;; Call the C compiler
(run-external-compiler (run-external-compiler
non-opts append-dirs prepend-dirs non-opts append-dirs prepend-dirs