Private module map for a framework

后端 未结 1 1325
自闭症患者
自闭症患者 2021-01-31 04:50

I\'m using this answer to create a module map to create a module for CommonCrypto so I can use it in a framework.

Doing this however means that any projects that I use t

1条回答
  •  走了就别回头了
    2021-01-31 05:41

    Disclaimer: I have not tried this for CommonCrypto but it works for my case with libz

    A possible solution to this is to create a module.private.modulemap as described in the Clang documentation

    So for example in FrameworkA you can write a module.modulemap file for FrameworkA like so:

    module FrameworkACommon {
    }
    

    Then you would create a module.private.modulemap file like so

    explicit  FrameworkACommon.Crypto [system] [extern_c] {
       header "/Applications/Xcode6-Beta5.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/usr/include/CommonCrypto/CommonCrypto.h"
        link "CommonCrypto"
        export *
    }
    

    Then repeat for FrameworkB.

    Now CommonCrypto is a private module in both FrameworkA and FrameworkB and the names won't clash.

    0 讨论(0)
提交回复
热议问题