Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doxygen not reading code guarded with macro

Tags:

doxygen

I am using doxygen to generate html help for our C++ API.

There are parts which are enabled/disabled in code such as

#ifdef EXPERIMENTAL_FEATURE1
class Experimental1
{
   ...
}
#endif

#ifdef EXPERIMENTAL_FEATURE2
class Experimental2
{
   ...
}
#endif

I set my doxygen PREDEFINED as follows:

PREDEFINED = EXPERIMENTAL_FEATURE1 EXPERIMENTAL_FEATURE2

This however doesn't cause doxygen to extract doc. for these classes. Log shows that doxygen reads the files.

Is the syntax for PREDEFINED correct (separated by space and without =)?

How can I debug this?

like image 989
Paul Avatar asked Oct 16 '25 01:10

Paul


1 Answers

Have a look into the doxygen manual:

http://www.doxygen.nl/manual/preprocessing.html

The typical syntax is:

PREDEFINED = "name1=value1" \
  "name2=value2" \
  "name3=value3"

In more detail the manual says:

The argument of the tag is a list of macros of the form: name or name=definition (no spaces). If the definition and the "=" are omitted, "=1" is assumed. To prevent a macro definition from being undefined via #undef or recursively expanded use the := operator instead of the = operator.

If you have no value you can simply write "name" - so your example should work.

Make sure that the following settings are correct within your doxyfile:

HIDE_UNDOC_CLASSES=NO
EXTRACT_ALL=YES
EXTRACT_LOCAL_CLASSES=YES

Otherwise classes aren't put into the documentation.

Also make sure ENABLE_PREPROCESSING is set to YES.

If all this doesn't help please post a minimal example that reproduces the problem.

like image 60
Klaus Saalfeld Avatar answered Oct 18 '25 23:10

Klaus Saalfeld



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!