@@ -92,44 +92,30 @@ confirmation before compiling."
92
92
(defvar vterm-install-buffer-name " *Install vterm* "
93
93
" Name of the buffer used for compiling vterm-module." )
94
94
95
- (defun vterm-module--cmake-is-available ()
96
- " Return t if cmake is available.
97
- CMake is needed to build vterm, here we check that we can find
98
- the executable."
99
-
100
- (unless (executable-find " cmake" )
101
- (error " Vterm needs CMake to be compiled. Please, install CMake " ))
102
- t )
103
-
104
95
;;;### autoload
105
96
(defun vterm-module-compile ()
106
97
" Compile vterm-module."
107
98
(interactive )
108
- (when (vterm-module--cmake-is-available)
109
- (let* ((vterm-directory
110
- (shell-quote-argument
111
- ; ; NOTE: This is a workaround to fix an issue with how the Emacs
112
- ; ; feature/native-comp branch changes the result of
113
- ; ; `(locate-library "vterm")'. See emacs-devel thread
114
- ; ; https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00306.html
115
- ; ; for a discussion.
116
- (file-name-directory (locate-library " vterm.el" t ))))
117
- (make-commands
118
- (concat
119
- " cd " vterm-directory " ; \
120
- mkdir -p build; \
121
- cd build; \
122
- cmake -G 'Unix Makefiles' "
123
- vterm-module-cmake-args
124
- " ..; \
125
- make; \
126
- cd -" ))
127
- (buffer (get-buffer-create vterm-install-buffer-name)))
128
- (pop-to-buffer buffer)
99
+ (unless (executable-find " cmake" )
100
+ (error " Vterm needs CMake to be compiled. Please, install CMake " ))
101
+ (let* ((vterm-directory
102
+ (shell-quote-argument
103
+ ; ; NOTE: This is a workaround to fix an issue with how the Emacs
104
+ ; ; feature/native-comp branch changes the result of
105
+ ; ; `(locate-library "vterm")'. See emacs-devel thread
106
+ ; ; https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00306.html
107
+ ; ; for a discussion.
108
+ (file-name-directory (locate-library " vterm.el" t ))))
109
+ (default-directory (expand-file-name " build" vterm-directory))
110
+ (make-commands (format " cmake -G 'Unix Makefiles' %s .. && make "
111
+ vterm-module-cmake-args)))
112
+ (make-directory default-directory t )
113
+ (with-current-buffer (get-buffer-create vterm-install-buffer-name)
129
114
(compilation-mode )
130
115
(if (zerop (let ((inhibit-read-only t ))
131
- (call-process " sh" nil buffer t " -c" make-commands)))
116
+ (call-process " sh" nil t t " -c" make-commands)))
132
117
(message " Compilation of `emacs-libvterm' module succeeded " )
118
+ (pop-to-buffer vterm-install-buffer-name)
133
119
(error " Compilation of `emacs-libvterm' module failed! " )))))
134
120
135
121
; ; If the vterm-module is not compiled yet, compile it
0 commit comments