Generate the compilation database through CMake
Use an Emacs directory-local variable to specify to ccls where the compilation directory lives, tell CMake to generate the compilation database, and remove bear from the environment. Add clang to the environment for clang-format.
This commit is contained in:
parent
50473e5ab5
commit
79c1056553
3 changed files with 8 additions and 1 deletions
4
.dir-locals.el
Normal file
4
.dir-locals.el
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
;;; Directory Local Variables
|
||||||
|
;;; For more information see (info "(emacs) Directory Variables")
|
||||||
|
|
||||||
|
((c-mode . ((ccls-args . '("--init={\"compilationDatabaseDirectory\": \"clox/_build\"}")))))
|
|
@ -2,4 +2,6 @@ cmake_minimum_required(VERSION 2.19)
|
||||||
|
|
||||||
project(Lox C)
|
project(Lox C)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -9,4 +9,5 @@
|
||||||
(specification->package "dejagnu")
|
(specification->package "dejagnu")
|
||||||
(specification->package "gcc-toolchain")
|
(specification->package "gcc-toolchain")
|
||||||
(specification->package "ccls")
|
(specification->package "ccls")
|
||||||
(specification->package "bear")))
|
;; For clang-format
|
||||||
|
(specification->package "clang")))
|
||||||
|
|
Loading…
Reference in a new issue