I am using YCM to work on a pretty large C project. I generate multiple executables/static libraries hence have multiple makefiles and so multiple compilation databases (generated using BEAR) for different parts of my project (Structure of the project in the image). My problem is that YCM seems to pick a single compilation database for all the files in my vim session based on the directory where I open vim. So for example if I were to edit my
mainserver/MainServer AND open vim in the same directory, YCM would load their corresponding compilation database and everything works great... BUT if I were to start editing my
misc/ArrayList in the same vim session then it would still use the compilation database from
mainserver/MainServer instead of from
My question is how do I get YCM to load a separate compilation database for every file based on its location instead of having YCM load a compilation database depending on where I initially opened vim.
My not very practical solution was to have a single compilation database in the root of my project and generate it by having a shell script find every makefile in my project and then have BEAR generate the compilation databases and append them all at the root of my project...I am hoping there is a better option than that....
Thanks a lot for any help