Skip to content

feature: module map umbrella wildcard without recursing into subdirectories #162847

@torarnv

Description

@torarnv

I’m setting up Clang module maps for Qt, and hitting a bit of a sharp corner in that umbrella “.” will recurse into every subdirectory. Same with umbrella header “foo.h” , but resulting in a tonne of -Wincomplete-umbrella warnings.

Our setup in Qt is that our per-module include dirs have a flat list of public API headers in say QtCore, and then we have QtCore/6.11.0/QtCore/ with (semi) private headers of various sorts.

umbrella “.” results in including all these of these private headers, which fails the module build due to unexpected include paths:

/Users/torarne/build/qt/6.x/qtbase/lib/QtCore.framework/./Versions/A/Headers/6.11.0/QtCore/private/qabstractanimation_p.h:22:10: fatal error: 
'private/qobject_p.h' file not found
   22 | #include <private/qobject_p.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
main.mm:3:9: fatal error: could not build module 'QtCore'

For framework builds on Apple platforms we could perhaps put the private headers in a PrivateHeaders directory inside the framework, but for non-framework builds on Apple platforms, or non-Apple platforms that would not work.

I tried exclude header “6.11.0/*" but doesn’t look like globs/wildcards can be used in modules.

Would be nice if there was some way to limit the wildcard inclusion, or to allow specifying wildcard exclusions. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions