• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1def config(conf)
2  toolchain :clang if ENV['MRUBY_CC'].include? "clang"
3  toolchain :gcc if ENV['MRUBY_CC'].include? "gcc"
4
5  conf.cc.command = ENV['MRUBY_CC']
6  conf.cxx.command = ENV['MRUBY_CXX']
7
8  if ENV['MRUBY_LD']
9    conf.linker.command = ENV['MRUBY_LD']
10  end
11  if ENV['MRUBY_AR']
12    conf.archiver.command = ENV['MRUBY_AR']
13  end
14
15  # C++ project needs this.  Without this, mruby exception does not
16  # properly destroy C++ object allocated on stack.
17  conf.enable_cxx_exception
18
19  conf.build_dir = ENV['BUILD_DIR']
20
21  # include the default GEMs
22  conf.gembox 'default'
23  conf.gem :core => 'mruby-eval'
24end
25
26if ENV['BUILD'] == ENV['HOST'] then
27  MRuby::Build.new do |conf|
28    config(conf)
29  end
30else
31  MRuby::CrossBuild.new(ENV['HOST']) do |conf|
32    config(conf)
33  end
34end
35