Sha256: c6e771f2ef87b7bfc8d009d4e4c0ccbf1853306eed21f54158e94d9d44a05c65

Contents?: true

Size: 806 Bytes

Versions: 4

Compression:

Stored size: 806 Bytes

Contents

require 'mkmf'
require 'fileutils'

unless pkg_config('libsnappy') || have_library('snappy')
  # build vendor/snappy
  pwd = File.dirname File.expand_path __FILE__
  dir = File.join pwd, '..', 'vendor', 'snappy'

  Dir.chdir(dir) do
    FileUtils.mkdir_p 'build'
    Dir.chdir(File.join(dir, 'build')) do
      `cmake .. -DCMAKE_BUILD_TYPE=Release`
    end
  end

  src = %w[
    config.h
    snappy-stubs-public.h
  ].map { |e| File.join dir, 'build', e }
  FileUtils.cp src, pwd, :verbose => true
  src = %w[
    snappy-c.cc
    snappy-c.h
    snappy-internal.h
    snappy-sinksource.cc
    snappy-sinksource.h
    snappy.cc
    snappy.h
    snappy-stubs-internal.cc
    snappy-stubs-internal.h
  ].map { |e| File.join dir, e }
  FileUtils.cp src, pwd, :verbose => true
end

create_makefile 'snappy_ext'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
snappy-0.2.0-java ext/extconf.rb
snappy-0.2.0 ext/extconf.rb
snappy-0.1.0-java ext/extconf.rb
snappy-0.1.0 ext/extconf.rb