summaryrefslogtreecommitdiffstats
path: root/tools/vim
diff options
context:
space:
mode:
authordzhioev@chromium.org <dzhioev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 12:21:37 +0000
committerdzhioev@chromium.org <dzhioev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-09 12:21:37 +0000
commite666f18cf2cd3ceed548708a00350d56ecfbcf24 (patch)
treec430ac8e19fb458a49d0e60665bb32bc3aa024dd /tools/vim
parentaef5aa5932d7eed84c5854cb054a27d5582630cc (diff)
downloadchromium_src-e666f18cf2cd3ceed548708a00350d56ecfbcf24.zip
chromium_src-e666f18cf2cd3ceed548708a00350d56ecfbcf24.tar.gz
chromium_src-e666f18cf2cd3ceed548708a00350d56ecfbcf24.tar.bz2
Pass "-std" flag to YCM config.
"-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
Diffstat (limited to 'tools/vim')
-rw-r--r--tools/vim/chromium.ycm_extra_conf.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/vim/chromium.ycm_extra_conf.py b/tools/vim/chromium.ycm_extra_conf.py
index ac9582d..6329b39 100644
--- a/tools/vim/chromium.ycm_extra_conf.py
+++ b/tools/vim/chromium.ycm_extra_conf.py
@@ -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
@@ -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