My preferred way for dealing with this kind of thing is to do something like this in the code:
change: #ifdef TGUI_HAS_BACKEND_SFML
to: #if defined(TGUI_HAS_BACKEND_SFML) || defined(DOXYGEN)
This works because Doxygen automatically defines the macro DOXYGEN when it processes the files, just make sure you do not define the DOXYGEN macro anywhere in your code of course
If you want both the #ifdef and an associated #else to be processed, you should also change any bare #else directives to be explicit #if's
so change:
#ifdef SOMETHING
...
#else
...
#endif
to:
#if defined(SOMETHING) || defined(DOXYGEN)
...
#endif
#if !defined(SOMETHING) || defined(DOXYGEN)
...
#endif
Two other ideas for dealing with this kind of thing in Doxygen is by editting the Doxyfile:
- use PREDEFINED = TGUI_HAS_BACKEND_SFML and PREDEFINED = TGUI_HAS_BACKEND_SDL
- This will define these both only for Doxygen, so you can leave your compile settings as they are.
- However, this method won't include the code within both an #ifdef and any associated bare #else, so you would have change any of such #else to explicit #ifdef or #if defined(...).
- use ENABLE_PREPROCESSING = NO
- This will disable all preprocessing, so you would get things within #ifdef and bare #else, but it might not be ideal because no preprocessing would be done at all.
change: #ifdef TGUI_HAS_BACKEND_SFML
to: #if defined(TGUI_HAS_BACKEND_SFML) || defined(DOXYGEN)
This works because Doxygen automatically defines the macro DOXYGEN when it processes the files, just make sure you do not define the DOXYGEN macro anywhere in your code of course
If you want both the #ifdef and an associated #else to be processed, you should also change any bare #else directives to be explicit #if's
so change:
#ifdef SOMETHING
...
#else
...
#endif
to:
#if defined(SOMETHING) || defined(DOXYGEN)
...
#endif
#if !defined(SOMETHING) || defined(DOXYGEN)
...
#endif
Two other ideas for dealing with this kind of thing in Doxygen is by editting the Doxyfile:
- use PREDEFINED = TGUI_HAS_BACKEND_SFML and PREDEFINED = TGUI_HAS_BACKEND_SDL
- This will define these both only for Doxygen, so you can leave your compile settings as they are.
- However, this method won't include the code within both an #ifdef and any associated bare #else, so you would have change any of such #else to explicit #ifdef or #if defined(...).
- use ENABLE_PREPROCESSING = NO
- This will disable all preprocessing, so you would get things within #ifdef and bare #else, but it might not be ideal because no preprocessing would be done at all.