-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ycm_extra_conf.py
80 lines (69 loc) · 2.15 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
75
76
77
78
79
80
import os
import ycm_core
def Subdirectories(directory):
res = []
for path, subdirs, files in os.walk(directory):
for name in subdirs:
item = os.path.join(path, name)
res.append(item)
return res
def IncludeFlagsOfSubdirectory( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_include_subdir = False
path_flags = [ '-ISUB']
for flag in flags:
# include the directory of flag as well
new_flag = [flag.replace('-ISUB', '-I')]
if make_next_include_subdir:
make_next_include_subdir = False
for subdir in Subdirectories(os.path.join(working_directory, flag)):
new_flag.append('-I')
new_flag.append(subdir)
for path_flag in path_flags:
if flag == path_flag:
make_next_include_subdir = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
for subdir in Subdirectories(os.path.join(working_directory, path)):
basename = os.path.basename(subdir)
if basename=="include" or basename=="inc":
new_flag.append('-I' + subdir)
break
new_flags =new_flags + new_flag
return new_flags
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-ferror-limit=1000',
'-DNDEBUG',
'-xc++',
'-std=c++11',
'-isystem/usr/include/',
'-isystem/usr/local/cuda/include/',
'-ISUBdeps/',
'-I./src/elsa',
'-I./src/utils/',
'-I./deps/modules/glm/',
'-I./deps/modules/spdlog/include/',
'-I./deps/modules/imgui/',
'-I./deps/modules/imgui/examples/',
'-I./deps/modules/glfw/deps/',
'-I./deps/modules/stb/',
'-I./deps/modules/assimp/include/',
'-I./deps/modules/osdialog/',
]
flags = IncludeFlagsOfSubdirectory(flags, "./" )
print(flags)
SOURCE_EXTENSIONS = ['.cpp', 'cxx', 'cc', '.c', '.h', '.hpp', 'cu']
def FlagsForFile(filename, **kwargs):
return {
'flags': flags,
'do_cache': True
}