Chen96
YCM is a pretty sweet engine, but how am I going to configure it if I'm doing unity build (the way handmade hero builds)? It seems to me that it treats every .cpp file as a separate compilation unit so it just breaks when I try to do unity build.
I have the same problem developing stb headers. When you are in the header, the #define IMPLEMENTATION isn't defined, so it doesn't parse this code.
It's a little janky, but I just make a define like this:
| #if defined(STB_IMPLEMENTATION) || defined(YCM_DEV)
// code here
#endif
|
Then I just add a
'-DYCM_DEV',
to the .ycm_extra_conf.py
You can also do this same thing and just add whatever includes you need
so ycm will find them but the unity build won't.
| #ifdef YCM_DEV
#include <stdio.h>
#include "thing.cpp"
// whatever else you need
#endif
|
It is kinda Janky but I haven't found a better way.