Skip to content

Commit 797357b

Browse files
mnewtSbozzolo
authored andcommitted
With the native-compile feature enabled, properly find build dir
When the native-compile feature is enabled, `locate-library` returns the path to the compiled (`.eln`) file rather than the `.el` or `.elc` that would otherwise be expected. Then `vterm-module-compile` runs the compilation from that subdirectory and can't find the expected files. `find-library-name` always returns the `.el` file location. Example error: CMake Error: The source directory "/Users/user/.emacs.d/straight/build/vterm/eln-x86_64-apple-darwin19.5.0-89a730c11dec204e" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. make: *** No targets specified and no makefile found. Stop.
1 parent f41849c commit 797357b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vterm.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ the executable."
104104
(when (vterm-module--cmake-is-available)
105105
(let* ((vterm-directory
106106
(shell-quote-argument
107-
(file-name-directory (locate-library "vterm"))))
107+
;; NOTE: This is a workaround to fix an issue with how the Emacs
108+
;; feature/native-comp branch changes the result of
109+
;; `(locate-library "vterm")'. See emacs-devel thread
110+
;; https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00306.html
111+
;; for a discussion.
112+
(file-name-directory (locate-library "vterm.el" t))))
108113
(make-commands
109114
(concat
110115
"cd " vterm-directory "; \

0 commit comments

Comments
 (0)