Skip to content

Commit

Permalink
Add -include-pch flag to the list of include flags
Browse files Browse the repository at this point in the history
  • Loading branch information
micbou committed Feb 17, 2016
1 parent 2c25d39 commit 5696336
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ycmd/completers/cpp/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
from ycmd.responses import NoExtraConfDetected

INCLUDE_FLAGS = [ '-isystem', '-I', '-iquote', '-isysroot', '--sysroot',
'-gcc-toolchain', '-include', '-iframework', '-F', '-imacros' ]
'-gcc-toolchain', '-include', '-include-pch', '-iframework',
'-F', '-imacros' ]

# We need to remove --fcolor-diagnostics because it will cause shell escape
# sequences to show up in editors, which is bad. See Valloric/YouCompleteMe#1421
Expand Down
11 changes: 6 additions & 5 deletions ycmd/tests/clang/flags_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,23 @@ def tester( flag ):
flags._RemoveUnusedFlags( expected + to_remove, filename ) )

eq_( expected,
flags._RemoveUnusedFlags( expected[ :1 ] + to_remove + expected[ 1: ],
filename ) )
flags._RemoveUnusedFlags( expected[ :1 ] + to_remove + expected[ 1: ],
filename ) )

eq_( expected + expected[ 1: ],
flags._RemoveUnusedFlags( expected + to_remove + expected[ 1: ],
flags._RemoveUnusedFlags( expected + to_remove + expected[ 1: ],
filename ) )

include_flags = [ '-isystem', '-I', '-iquote', '-isysroot', '--sysroot',
'-gcc-toolchain', '-include', '-iframework', '-F', '-imacros' ]
'-gcc-toolchain', '-include', '-include-pch',
'-iframework', '-F', '-imacros' ]
to_remove = [ '/moo/boo' ]
filename = 'file'

for flag in include_flags:
yield tester, flag



def RemoveXclangFlags_test():
expected = [ '-I', '/foo/bar', '-DMACRO=Value' ]
to_remove = [ '-Xclang', 'load', '-Xclang', 'libplugin.so',
Expand Down Expand Up @@ -224,6 +224,7 @@ def CompilerToLanguageFlag_ReplaceCppCompiler_test():
for compiler in compilers:
yield _ReplaceCompilerTester, compiler, 'c++'


def ExtraClangFlags_test():
flags_object = flags.Flags()
num_found = 0
Expand Down

0 comments on commit 5696336

Please sign in to comment.