le0pard/webp-ffi

View on GitHub
ext/webp_ffi/Rakefile

Summary

Maintainability
Test Coverage
require 'ffi-compiler/compile_task'

FFI::Compiler::CompileTask.new('webp_ffi') do |c|
  c.have_header?('stdio.h', '/usr/local/include')
  c.have_func?('puts')
  c.have_library?('z')
  # webp
  c.have_header?('decode.h', '/usr/local/include')
  c.have_header?('encode.h', '/usr/local/include')
  c.have_func?('WebPDecoderConfig')
  c.have_func?('WebPGetInfo')
  c.have_library?('webp')
  # libs
  c.have_library?('png')
  c.have_library?('jpeg')
  c.have_library?('tiff')
  c.ldflags << ENV['LD_FLAGS'] if ENV['LD_FLAGS']
  c.cflags << ENV['C_FLAGS'] if ENV['C_FLAGS']
end