Skip to content

doxygen: fix and improve macro expansion configuration options #1353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@ MACRO_EXPANSION = YES
# The default value is: NO.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_ONLY_PREDEF = YES
EXPAND_ONLY_PREDEF = NO

# If the SEARCH_INCLUDES tag is set to YES, the include files in the
# INCLUDE_PATH will be searched if a #include is found.
Expand Down Expand Up @@ -2430,8 +2430,12 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \
PREDEFINED = BSONCXX_ABI_CDECL= \
BSONCXX_ABI_EXPORT= \
BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \
BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR= \
MONGOCXX_ABI_CDECL= \
MONGOCXX_ABI_EXPORT= \
MONGOCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \
MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR=

Expand All @@ -2442,14 +2446,7 @@ PREDEFINED = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \
# definition found in the source code.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \
BSONCXX_ABI_EXPORT \
BSONCXX_ABI_NO_EXPORT \
BSONCXX_DEPRECATED \
MONGOCXX_ABI_CDECL \
MONGOCXX_ABI_EXPORT \
MONGOCXX_ABI_NO_EXPORT \
MONGOCXX_DEPRECATED
EXPAND_AS_DEFINED =

# If the SKIP_FUNCTION_MACROS tag is set to YES then Doxygen's preprocessor will
# remove all references to function-like macros that are alone on a line, have
Expand All @@ -2459,7 +2456,7 @@ EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \
# The default value is: YES.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

SKIP_FUNCTION_MACROS = YES
SKIP_FUNCTION_MACROS = NO

#---------------------------------------------------------------------------
# Configuration options related to external references
Expand Down
5 changes: 5 additions & 0 deletions src/bsoncxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ if(1)
/// @warning For internal use only!
///

// Doxygen `PREDEFINED` does not define the macro *in code* as required by `@def`.
#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
#define BSONCXX_ABI_EXPORT ...
#endif

///
/// @def BSONCXX_ABI_EXPORT
/// @hideinitializer
Expand Down
5 changes: 5 additions & 0 deletions src/mongocxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ if(1)

#define MONGOCXX_ABI_EXPORT_CDECL(...) MONGOCXX_ABI_EXPORT __VA_ARGS__ MONGOCXX_ABI_CDECL

// Doxygen `PREDEFINED` does not define the macro *in code* as required by `@def`.
#if defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
#define MONGOCXX_ABI_EXPORT ...
#endif

///
/// @file
/// Provides macros to control the set of symbols exported in the ABI.
Expand Down