-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.ycm_extra_conf.py
75 lines (64 loc) · 1.85 KB
/
.ycm_extra_conf.py
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
74
import os
def abspath(x):
return os.path.abspath(os.path.normpath(os.path.expanduser(x)))
def copath(x):
return os.path.abspath(os.path.normpath(os.path.join(__file__, "..", os.path.expanduser(x))))
base = os.path.normpath(os.path.realpath(os.path.dirname(__file__)))
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-std=c++14',
'-x', 'c++',
# ubuntu 16
'-isystem', '/usr/include/c++/7',
'-isystem', '/usr/include/x86_64-linux-gnu/c++/7',
'-isystem', '/usr/include/c++/7/backward',
'-isystem', '/usr/local/include',
'-isystem', '/usr/include/x86_64-linux-gnu',
'-isystem', '/usr/include',
# freebsd (w/ clang-devel)
'-isystem', '/usr/include/c++/v1',
'-isystem', '/usr/local/llvm-devel/lib/clang/8.0.0/include',
# mac
'-isystem', '/opt/local/libexec/llvm-7.0/include/c++/v1',
'-isystem', '/opt/local/libexec/llvm-7.0/lib/clang/7.0.1/include',
'-isystem', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include',
# zdock/libpdb
'-I', 'contrib/eigen',
'-I', 'contrib/Catch2/single_include',
'-I', 'src/libpdb++',
'-I', 'src/zdock',
'-I', 'src/common',
'-I', 'src/pdb',
'-I', 'src',
'-I', 'include',
]
def parsepaths(flags):
stash = []
for x in flags:
if x not in ['-I', '-isystem']:
if stash:
if os.path.isdir(abspath(x)):
while stash:
yield stash.pop()
yield abspath(x)
elif os.path.isdir(copath(x)):
while stash:
yield stash.pop()
yield copath(x)
else:
stash = []
else:
yield x
else:
stash.append(x)
def FlagsForFile(filename, *args, **kwargs):
ret = {
'flags': parsepaths(flags + ['-I', abspath(os.path.dirname(filename))]),
'do_cache': True
}
return ret