Xcode 7.3 beta 1 vs. CommonCrypto in Swift

痞子三分冷 提交于 2019-12-08 17:14:36

问题


I'm using CommonCrypto in a Swift framework - and it's been working fine for over a year.

I used solutions found here: Importing CommonCrypto in a Swift framework

Specifically, to reference CommonCrypto from the Swift framework, I had to:

Create a module.map file in a folder named CommonCrypto next to my framework's Xcode project. module.map contents:

module CommonCrypto [system]
{
    header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
    link "CommonCrypto"
    export *
}
  • In my framework project's Swift Import Paths, I add CommonCrypto
  • In my framework project's Library Search Paths, I include: $(SDKROOT)/usr/lib/system
  • In my source, I include: import CommonCrypto

This worked fine; a little convoluted - but it worked.

However, in Xcode 7.3 beta 1 (7D111g), this technique no longer works.

It appears that libcommonCrypto.tbd has been removed from: $(SDKROOT)/usr/lib/system inside Xcode-beta.app. And I can't find it anywhere under the iPhoneOS SDK folder structure.

So I get these errors:

ld: warning: directory not found for option '-L/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib/system' ld: library not found for -lCommonCrypto for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

It would be great if the crazy module map business was replaced with something simpler. Like for instance, just using import CommonCrypto

In any case, I'm not sure how to resolve this, so any help is appreciated.

I'm asking here as a new question in the event that the solution is substantially different from solutions found in the previous question, although I appreciate this may not be appropriate.


回答1:


It looks like the solution is to remove the line:

link "CommonCrypto"

from the module.map file.



来源:https://stackoverflow.com/questions/34772239/xcode-7-3-beta-1-vs-commoncrypto-in-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!