X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/7df1430f6711f56133614bc2eec508618322b9a9..148295024c93e47f90ac850bf068e592b16b1c7c:/vim/ycm_extra_conf.py diff --git a/vim/ycm_extra_conf.py b/vim/ycm_extra_conf.py index 391fa8c..ac15c22 100644 --- a/vim/ycm_extra_conf.py +++ b/vim/ycm_extra_conf.py @@ -3,29 +3,35 @@ import shlex import subprocess import ycm_core -# These are the compilation flags that will be used in case there's no -# compilation database set (by default, one is not set). -# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. -flags = [ -'-Wall', -# '-Wextra', -# '-Wshadow', -# '-Werror', -# '-Wc++98-compat', -# '-Wno-long-long', -# '-Wno-variadic-macros', -# '-fexceptions', -# '-DNDEBUG', -'-std=c++11', -'-stdlib=libc++', -'-x', 'c++', -'-I', '.', -'-I', './include', -'-isystem', '/usr/include/c++/4.9.0', -'-isystem', '/usr/include/c++/4.9.0/x86_64-unknown-linux-gnu', -'-isystem', '/usr/include/c++/4.9.0/backward', -'-isystem', '/usr/lib/clang/3.4.1/include' -] +def FlagsForFile( filename, **kwargs ): + client_data = kwargs['client_data'] + cwd = client_data['getcwd()'] + # These are the compilation flags that will be used in case there's no + # compilation database set (by default, one is not set). + flags = [ + '-Wall', + # '-Wextra', + # '-Wshadow', + # '-Werror', + # '-Wc++98-compat', + # '-Wno-long-long', + # '-Wno-variadic-macros', + # '-fexceptions', + # '-DNDEBUG', + '-std=c++11', + '-stdlib=libstdc++', + '-x', 'c++', + '-I', '.', + '-I', './include', + ] + flags += rospack() + relative_to = cwd + final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + + return { + 'flags': final_flags, + 'do_cache': True + } # This function makes it easy to pull in additional flags from rospack def rospack(): @@ -43,7 +49,6 @@ def rospack(): includes += ['-isystem', include] return filter(lambda a: a != ' ', includes) -flags += rospack() def DirectoryOfThisScript(): return os.path.dirname( os.path.abspath( __file__ ) ) @@ -76,11 +81,3 @@ def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): new_flags.append( new_flag ) return new_flags -def FlagsForFile( filename, **kwargs ): - relative_to = DirectoryOfThisScript() - final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) - - return { - 'flags': final_flags, - 'do_cache': True - }