You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Presently, it's unnecessarily ambiguous where inclusions are pointing to.
Example of ambiguity: #include "somefile.h"
possible locations:
relative to current working directory (including path traversals)
relative to directories listed in include_directories (i.e. Descent3, lib, netcon/includes, or netgames/includes directory)
Solution:
inclusions relative to current working directory use quotes exclusively. i.e. #include "somefile.h" is always relative to present file)
inclusions relative to project directory use angle brackets exclusively. e.g. #include <lib/somefile.h>
inclusion paths should be relative to the main project directory. e.g. #include "<renderer/RendererConfig.h> instead of #include "../renderer/RendererConfig.h"
included system files should always come before included project files and both sections should be identified as such.
Conclusion;
It's minor detail if you know the code base and the build system but for everyone that does not then it's frustrating to track down ambiguous includes. Having only briefly used the CMake build system I can confidently attest that this can be a sizable impediment for new contributors.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem:
Presently, it's unnecessarily ambiguous where inclusions are pointing to.
Example of ambiguity:
#include "somefile.h"
possible locations:
include_directories
(i.e.Descent3
,lib
,netcon/includes
, ornetgames/includes
directory)Solution:
#include "somefile.h"
is always relative to present file)#include <lib/somefile.h>
#include "<renderer/RendererConfig.h>
instead of#include "../renderer/RendererConfig.h"
Conclusion;
It's minor detail if you know the code base and the build system but for everyone that does not then it's frustrating to track down ambiguous includes. Having only briefly used the CMake build system I can confidently attest that this can be a sizable impediment for new contributors.
Beta Was this translation helpful? Give feedback.
All reactions