Sha256: bcd2fc40458de96bcd17e14491447e069117fbb9a24f49a3c1fd996a5e44958e

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

require 'mkmf'
require 'libv8/arch'
module Libv8

  module_function

  def libv8_object(name)
    filename = "#{libv8_source_path}/out/#{Libv8::Arch.libv8_arch}.release/libv8_#{name}.#{$LIBEXT}"
    unless File.exists? filename
      filename = "#{libv8_source_path}/out/#{Libv8::Arch.libv8_arch}.release/obj.target/tools/gyp/libv8_#{name}.#{$LIBEXT}"
    end
    return filename
  end

  def libv8_base
    libv8_object :base
  end

  def libv8_snapshot
    libv8_object :snapshot
  end

  def libv8_nosnapshot
    libv8_object :nosnapshot
  end

  def libv8_objects(*names)
    names = [:base, :snapshot] if names.empty?
    names.map do |name|
      fail "no libv8 object #{name}" unless File.exists?(object = libv8_object(name))
      object
    end
  end

  def libv8_ldflags
    "-L#{libv8_base} -L#{libv8_snapshot}"
  end

  def libv8_include_flags
    "-I#{libv8_include_path}"
  end

  def libv8_include_path
    "#{libv8_source_path}/include"
  end

  def libv8_source_path
    File.expand_path "../../vendor/v8", __FILE__
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
libv8-3.11.8.3-x86_64-darwin-10 lib/libv8.rb
libv8-3.11.8.3 lib/libv8.rb
libv8-3.11.8.3-x86_64-linux lib/libv8.rb
libv8-3.11.8.1 lib/libv8.rb
libv8-3.11.8.0 lib/libv8.rb
libv8-3.10.8.0-x86_64-darwin-10 lib/libv8.rb
libv8-3.10.8.0 lib/libv8.rb