Basically, I am asking, whether my code should say
#include “../libs/src/my_lib.h”
or
#include “my_lib.h”
with a complier option of
-I ../libs/src/
I feel (reasonably strongly) that the former is preferable, because:
- it is independent of build system
- it specifies exactly which “my_lib” is meant, in case there are several.
My current project uses the latter style, with -I
in the project file, saying that:
- we will never change build system, compiler or platform
- every file has a unique name
That actually sounds reasonable, so I wonder if I am just being influenced by opinion, or whether there is any technical reason (not an opinion) to prefer one approach over the other.