10

I have created one framework named Communication, inside framework container there is one module.modulemap file.

module.modulemap

framework module Communication {
  umbrella header "Communication.h"

  export *
  module * { export * }
}

I can understand that module required umbrella header to expose it to containing application/target.

But what is meaning of other two lines of code.

  export *
  module * { export * }

If any have idea what this lines exporting ?

technerd
  • 13,664
  • 9
  • 58
  • 85

1 Answers1

1

Objective-C Module Map(.modulemap) for Objective-C and Swift

Objective-C language exposes API thought .modulemap for Objective-C and Swift languages

[ObjC Module]

[Custom .modulemap]

It is about LLVM Modules and Module Map Language. Modulemap exposes C header files for external binaries. It is a bridge between module and headers. Modulemap helps to convert #include, #import -> @import because it has a mapping between module name and headers inside. Also modulemap helps to create standalone additional modules and submodules. Modulemap can contains a lot of modules(only one has to have the same name as product name) and a lot of submodules

//Objective-C exposes API thought .modulemap for Objective-C and Swift

.h.m uses .h.m = Objective-C consumer, Objective-C producer = .modulemap
.swift uses .h.m = Swift consumer, Objective-C producer = .modulemap

Framework which includes .modulemap is called Modular Framework. Path:

module_name.framework/Modules/module_name.modulemap

Setup

  • When you create a library[Example] you should create and setup it manually
  • When you create a framework[Example] it is setup automatically

Even if you create Swift framework Xcode automatically creates modulemap

[Mixing Objective-C and Swift in the same Application]

yoAlex5
  • 21,739
  • 5
  • 148
  • 151
  • 1
    This does not answer what `export` means. – ray Jan 19 '22 at 17:03
  • @ray, https://stackoverflow.com/questions/30704268/no-umbrella-header-found-for-target-module-map-will-not-be-generated/57665560#57665560 – yoAlex5 Jan 19 '22 at 17:07