本文介绍了每个框架内的 module.modulemap 文件中的 export * 是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为Communication 的框架,在框架容器内有一个module.modulemap 文件.

module.modulemap

框架模块通讯{伞头Communication.h"出口 *模块 * { 导出 * }}

我可以理解该模块需要伞形标头才能将其公开给包含应用程序/目标.

但是另外两行代码是什么意思.

 导出 *模块 * { 导出 * }

如果有人知道这行输出的是什么?

解决方案

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

Objective-C 语言为 Objective-C 和 Swift 语言公开 API 思想 .modulemap

您应该手动创建和设置它

  • 创建框架时会自动设置
  • 即使你创建了 Swift 框架 Xcode 也会自动创建 modulemap

    [在同一个应用程序中混合使用 Objective-C 和 Swift]

    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 ?

    解决方案

    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 you should create and setup it manually
    • When you create a framework it is setup automatically

    Even if you create Swift framework Xcode automatically creates modulemap

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

    这篇关于每个框架内的 module.modulemap 文件中的 export * 是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    06-23 13:42