来源: https://github.com/BradLarson/GPUImage2/issues/1
支持swift4
For Swift 4, here's an update to @m1entus's local podspec:
# based on https://github.com/BradLarson/GPUImage2/issues/1#issuecomment-228542480
Pod::Spec.new do |s|
s.name = 'GPUImage2'
s.version = '0.1.0'
s.license = 'BSD'
s.summary = 'An open source iOS framework for GPU-based image and video processing.'
s.homepage = 'https://github.com/BradLarson/GPUImage2'
s.author = { 'Brad Larson' => 'contact@sunsetlakesoftware.com' }
# This commit on that fork of GPUImage should contain just upgrades needed for Swift 4 compatibility. See https://github.com/BradLarson/GPUImage2/pull/212
# Replace with https://github.com/BradLarson/GPUImage2.git when merged
# into BradLarson's repository.
s.source = { :git => 'https://github.com/andrewcampoli/GPUImage2', :commit => '148c84e6b4194daeba122e77449f5ee9c8188161' }
s.source_files = 'framework/Source/**/*.{swift}'
s.resources = 'framework/Source/Operations/Shaders/*.{fsh}'
s.requires_arc = true
s.xcconfig = { 'CLANG_MODULES_AUTOLINK' => 'YES', 'OTHER_SWIFT_FLAGS' => "$(inherited) -DGLES"}
s.ios.deployment_target = '8.0'
s.ios.exclude_files = 'framework/Source/Mac', 'framework/Source/Linux', 'framework/Source/Operations/Shaders/ConvertedShaders_GL.swift'
s.frameworks = ['OpenGLES', 'CoreMedia', 'QuartzCore', 'AVFoundation']
end
Usage
- Save this as
GPUImage2.podspec
in the directory where your Podfile is. - Add the following line to your Podfile:
pod 'GPUImage2', :podspec => './GPUImage2.podspec'
- run
pod install
(you may have to close and re-open your Xcode workspace.) - you can now
import GPUImage2
网友评论