0 Star 0 Fork 0

大地小神/vim

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ycm_extra_conf_cpp.py 1.49 KB
一键复制 编辑 原始数据 按行查看 历史
大地小神 提交于 2019-12-25 10:05 +08:00 . fix warning
import os
flags = [
'-Wall',
'-Wextra',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-stdlib=libc++',
'-std=c++11',
'-x',
'c++',
'-I',
'.',
'-isystem',
'/usr/include',
'-isystem',
'/usr/local/include',
'-isystem',
'/usr/include/c++/v1',
]
SOURCE_EXTENSIONS = ['.cpp', '.cxx', '.cc', '.c', '.m', '.mm']
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspath(__file__))
def IsHeaderFile(filename):
extension = os.path.splitext(filename)[1]
return extension in ['.h', '.hxx', '.hpp', '.hh']
SRC_DIR = [
'your project subdir-1',
'your project subdir-2/subdir-3',
]
def SearchHeaderDirs(path, working_directory):
if not path.startswith('/'):
path = os.path.join(working_directory, path)
for root, dirs, files in os.walk(path):
if os.path.basename(root) in ['include', 'inc', 'Include', 'Inc']:
flags.append('-I')
flags.append(root)
else:
for file in files:
if IsHeaderFile(file):
flags.append('-I')
flags.append(root)
break
def Settings(filename, **kwargs):
relative_to = DirectoryOfThisScript()
for dir in SRC_DIR:
SearchHeaderDirs(dir, relative_to)
return {
'flags': flags,
'include_paths_relative_to_dir': relative_to,
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lidongai/vim.git
git@gitee.com:lidongai/vim.git
lidongai
vim
vim
master

搜索帮助