Valloric/YouCompleteMe — pull request #910 by nickhutchinson (2014-03-27 08:24:33+00:00)
Title: Fix libclang's #include search path

Fixes #809.

It appears `libclang.(dylib|so)` looks for the builtin compiler includes directory relative to itself at `./clang/3.4/include/`. YCM instead feeds libclang its own copy of the builtin headers using the compiler flag `-isystem ~/.vim/bundle/YouCompleteMe/python/clang_includes` or similar. This means the include search path is messed up: builtin headers now come *after* `/usr/include` and friends, when they should really come before. In previous llvm releases this didn't actually matter, but as of llvm 3.4 it interacts badly with their new "modules" feature.

Changes:
- Remove the python/clang_includes/ folder, update flags.py to stop passing it to libclang as a compiler flag
- Update CMake build script to copy the `lib/clang` directory from the LLVM source tree to `PATH_TO_YCM/python/clang`.

Seems to work on OS X and Debian. I haven't tested this change on Windows, because it looks truly painful to get YCM running there.