Doxygen All Conditional Document Defines

I have a project where I have a significant number of conditional definitions to facilitate cross-platform development. However, I have problems that convince Doxygen to retrieve all the definitions, as they will only raise the ones that have just been evaluated.

For example, in the next snippet, Doxygen will document TARGET_X86_64, but not TARGET_ARM64.

#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__)
/** Build target is ARM64 if defined. */
#define TARGET_ARM64
#else
/** Build target is x86_64 if defined. */
#define TARGET_X86_64
#endif

Enabling EXTRACT_ALL did not help, and disabling preprocessing causes Doxygen to not document anything at all. How to get doxygen to extract documentation for both cases?

+4
source share
1 answer

"" , . , #elseif, #if. .

.

/** Some define */
#define TARGET_DEFINE

/** Some other define */
#define OTHER_TARGET_DEFINE

-, , .

#if !(ORIGINAL_LOGIC)
#undef TARGET_DEFINE
#endif

, , undefined, doxygen .

#if !defined(DOXYGEN)
...
0

Source: https://habr.com/ru/post/1664033/


All Articles