Skip to content

Clean up public headers using CMake configure_file (@ONLY) for system header subsitution #8038

Description

@bin-wang

#8025 Introduces inline conditional include logic for system headers in exported public API headers. For example, in dr_defines.h (generated from globals_api.h):

#ifdef LINUX_KERNEL
#    include <linux/stdarg.h>
#else
#    include <stdarg.h> /* for varargs */
#endif

This duplicates the logic in stdarg_wrapper.h. However, because stdarg_wrapper.h is not exported, we cannot use it in dr_defines.h. This clutters exported public headers and duplicates the wrapper logic.

We think the proper solution is to use CMake configure-time variable substitution (configure_file with @ONLY) when exporting public API headers, such that system header dependencies are resolved at build configuration time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions