forked from Tokutek/mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dir-locals.el
73 lines (73 loc) · 4.95 KB
/
.dir-locals.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;; Set some emacs options to follow the mongo style: http://www.mongodb.org/about/contributors/kernel-code-style/
;; You should also install google-c-style (available in the ELPA or from http://google-styleguide.googlecode.com/svn/trunk/google-c-style.el)
(
(nil . ((c-file-style . "Google")
(c-basic-offset . 4)
(indent-tabs-mode . nil)
(fill-column . 100)))
(c-mode . ((eval . (setq ac-clang-flags
(let* ((cppdefs '(("_SCONS" . "1")
("MONGO_EXPOSE_MACROS" . "1")
("SUPPORT_UTF8" . "1")
("_FILE_OFFSET_BITS" . "64")
("_DEBUG" . "1")
("BOOST_ALL_NO_LIB" . "1")
("MONGO_HAVE_HEADER_UNISTD_H" . "1")
("MONGO_HAVE_EXECINFO_BACKTRACE" . "1")
))
(project-root (expand-file-name (locate-dominating-file buffer-file-name ".dir-locals.el")))
(includes '("/"
"/mongo"
"/third_party/pcre-8.30"
"/third_party/boost"
))
(cflags '("-pthread"
"-Wall"
"-Wsign-compare"
"-Wno-unknown-pragmas"
"-Winvalid-pch"
"-Werror"
))
(cxxflags '("-Wnon-virtual-dtor"
"-Woverloaded-virtual"
))
(cppflags (append (mapcar (lambda (x)
(concat "-D" (car x) "=" (cdr x)))
cppdefs)
(mapcar (lambda (x)
(concat "-I" project-root "src" x))
includes))))
(append cppflags cflags))))))
(c++-mode . ((eval . (setq ac-clang-flags
(let* ((cppdefs '(("_SCONS" . "1")
("MONGO_EXPOSE_MACROS" . "1")
("SUPPORT_UTF8" . "1")
("_FILE_OFFSET_BITS" . "64")
("_DEBUG" . "1")
("BOOST_ALL_NO_LIB" . "1")
("MONGO_HAVE_HEADER_UNISTD_H" . "1")
("MONGO_HAVE_EXECINFO_BACKTRACE" . "1")
))
(project-root (expand-file-name (locate-dominating-file buffer-file-name ".dir-locals.el")))
(includes '("/"
"/mongo"
"/third_party/pcre-8.30"
"/third_party/boost"
))
(cflags '("-pthread"
"-Wall"
"-Wsign-compare"
"-Wno-unknown-pragmas"
"-Winvalid-pch"
"-Werror"
))
(cxxflags '("-Wnon-virtual-dtor"
"-Woverloaded-virtual"
))
(cppflags (append (mapcar (lambda (x)
(concat "-D" (car x) "=" (cdr x)))
cppdefs)
(mapcar (lambda (x)
(concat "-I" project-root "src" x))
includes))))
(append cppflags cflags cxxflags)))))))