I couldn't find any prior threads that matched my situation and I know this is more of a Clang question but my issue is while trying to integrate with a Swift project so I'm giving it a shot.
I am getting "Umbrella header for module ... does not include ..." warnings for C header files that are intentionally not in the umbrella header and which I don't care to expose to my Cocoa Touch Framework. The headers in the warnings are ones that are only needed during the compilation of the static library I'm linking in. I would like to "do the right thing" and satisfy the compiler without just turning off warnings.
I have a 3rd party C library with its own makefile that builds a single static lib. It has an /include
folder with an umbrella header. The include folder contains other header files included by the umbrella and some that are not included in the umbrella. I created a module map file and placed it at the top of /include
that looks like:
module SomeModule {
umbrella header "somemodule.h"
export *
}
Then from my Cocoa Touch Framework build settings I added to SWIFT_INCLUDE_PATHS the path to this /include
folder.
The include folder structure looks something like:
/include/somemodule.h (The umbrella header)
/include/folderA/header1.h
/include/folderA/header2.h
/include/folderB/header1.h
....
As best I can tell, the "Umbrella header ... does not include header" warning is because the /include
folder contains headers not imported by the umbrella header. Is this determined to be "wrong" even if another module never references the headers that exist, but aren't in the umbrella header? If I wanted to stop the warnings, what do I need to do? Move the non-umbrella-imported headers into a different path?