Coder Social home page Coder Social logo

commoncryptoforpodspec's Introduction

CommonCryptoForPodspec

CommonCryptopodspec中的使用。其实CommonCrypto是一个常用的,其他的这样的C库同样可以采用这种方式使用。

需要的配置

.podspec中增加:

s.pod_target_xcconfig = { 'SWIFT_INCLUDE_PATHS' => '$(PODS_ROOT)/CommonCrypto/' }
s.prepare_command = <<-EOF
    if [ ! -d ./Pods/CommonCrypto ]; then
        mkdir -p ./Pods/CommonCrypto
        cat <<-EOF > ./Pods/CommonCrypto/module.modulemap
        module CommonCrypto [system] {
            header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCrypto.h"
            export *
        }
        \EOF
    fi
EOF

在需要的.swift

import CommonCrypto

需要注意

  • 有的机器/usr/include/CommonCrypto/CommonCrypto.h是不存在的😂,好坑,于是用这个"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/CommonCrypto/CommonCrypto.h目录吧。
  • 这个prepare_command的执行和.podspec有关系。也就是说只有podspec在安装的时候这个脚本才会执行,这个不变色这个脚本就不会执行。

commoncryptoforpodspec's People

Contributors

madordie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.