Sha256: a77d869d5e0806fae37aaed34f14a066f6681ec449ad0d80412b21a3e586f1f3

Contents?: true

Size: 1016 Bytes

Versions: 4

Compression:

Stored size: 1016 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

4 entries across 4 versions & 1 rubygems

Version Path
script_core-0.1.1 ext/enterprise_script_service/mruby_config.rb
script_core-0.1.0 ext/enterprise_script_service/mruby_config.rb
script_core-0.0.6 ext/enterprise_script_service/mruby_config.rb
script_core-0.0.5 ext/enterprise_script_service/mruby_config.rb