Skip to content

Commit

Permalink
Pass "-std" flag to YCM config.
Browse files Browse the repository at this point in the history
"-std" has value which is not equal to default value "c++11" for some variants
of Chrome build. At least for "chromeos=1 clang=1" build "-std=gnu++11" is set.
So not passing "-std" to YCM caused compilation error inside YCM, hence there
were some problems with completion.

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/104503016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243862 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dzhioev@chromium.org committed Jan 9, 2014
1 parent aef5aa5 commit e666f18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/vim/chromium.ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename):
else:
return chrome_flags

# Parse out the -I and -D flags. These seem to be the only ones that are
# important for YCM's purposes.
# Parse flags that are important for YCM's purposes.
for flag in clang_line.split(' '):
if flag.startswith('-I'):
# Relative paths need to be resolved, because they're relative to the
Expand All @@ -171,6 +170,8 @@ def GetClangCommandFromNinjaForFilename(chrome_root, filename):
else:
abs_path = os.path.normpath(os.path.join(out_dir, flag[2:]))
chrome_flags.append('-I' + abs_path)
elif flag.startswith('-std'):
chrome_flags.append(flag)
elif flag.startswith('-') and flag[1] in 'DWFfmO':
if flag == '-Wno-deprecated-register' or flag == '-Wno-header-guard':
# These flags causes libclang (3.3) to crash. Remove it until things
Expand Down

0 comments on commit e666f18

Please sign in to comment.