Sha256: 9e985e1fc5db954446a779f74cea854f9051b27fb14fdb5702ddd4cc9e94fc09

Contents?: true

Size: 1015 Bytes

Versions: 3

Compression:

Stored size: 1015 Bytes

Contents

# frozen_string_literal: true

require_relative("./flags")

mruby_engine_gembox_path =
  if ENV["MRUBY_ENGINE_GEMBOX_PATH"] && File.exist?(ENV["MRUBY_ENGINE_GEMBOX_PATH"])
    raise "`#{ENV['MRUBY_ENGINE_GEMBOX_PATH']}` require `.gembox` extension" unless ENV["MRUBY_ENGINE_GEMBOX_PATH"].end_with?(".gembox")
    Pathname.new ENV["MRUBY_ENGINE_GEMBOX_PATH"][0..-8]
  else
    Pathname.new(__FILE__).dirname.join("mruby_engine")
  end

MRuby::Build.new do |conf|
  toolchain(:gcc)

  enable_debug

  conf.gembox(mruby_engine_gembox_path)
  conf.gem(core: "mruby-bin-mirb")
  conf.gem(core: "mruby-bin-mruby")

  conf.bins = %w[mrbc mruby]

  conf.cc do |cc|
    cc.flags += %w[-fPIC]
    cc.flags += Flags.cflags
    cc.defines += Flags.io_safe_defines
  end
end

MRuby::CrossBuild.new("sandbox") do |conf|
  toolchain(:gcc)

  enable_debug

  conf.gembox(mruby_engine_gembox_path)

  conf.bins = []

  conf.cc do |cc|
    cc.flags += %w[-fPIC]
    cc.flags += Flags.cflags
    cc.defines += Flags.defines
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
script_core-0.0.4 ext/enterprise_script_service/mruby_config.rb
script_core-0.0.3 ext/enterprise_script_service/mruby_config.rb
script_core-0.0.2 ext/enterprise_script_service/mruby_config.rb