Created by: robbertvanginkel
When the modular = True
flag is set on apple_library
, create a module.modulemap
for modular imports of Objective C code into into swift. Support for both cross target imports and mixed target imports.
Cross targets the module.modulemap
file will be auto detected in a header search path, which will allow modular import of a target into swift and objective-c. Currently this only works when apple.use_header_maps_in_xcode
is set to false
.
Mixed modular apple_libraries supported through the -import-underlying-module
flag. In the case of a mixed (swift source + at least one header file) apple_library
, a objc.modulemap
is created that references the defined target headers excluding the generated swift header. When compiling the swift part of the target this partial modulemap then overrides the complete modulemap through the use of a vfsoverlay.
Also adds an optional config generate_missing_umbrella_headers
to the [apple]
section, which generates an umbrella header if no umbrella header is present.
(Note that this is stacked on PR #1561, but I can't seem to change that base so until that lands you can review this without looking at 951871c but 951871c...ea3f297)