make mruby build directory customizable

This commit is contained in:
take_cheeze
2014-02-23 20:33:55 +09:00
parent e202d4cd53
commit dd68ea9799
+5 -3
View File
@@ -52,7 +52,7 @@ module MRuby
Exts = Struct.new(:object, :executable, :library)
def initialize(name='host', &block)
def initialize(name='host', build_dir=nil, &block)
@name = name.to_s
unless MRuby.targets[@name]
@@ -62,9 +62,11 @@ module MRuby
@exts = Exts.new('.o', '', '.a')
end
build_dir = build_dir || ENV['MRUBY_BUILD_DIR'] || "#{MRUBY_ROOT}/build"
@file_separator = '/'
@build_dir = "#{MRUBY_ROOT}/build/#{@name}"
@gem_clone_dir = "#{MRUBY_ROOT}/build/mrbgems"
@build_dir = "#{build_dir}/#{@name}"
@gem_clone_dir = "#{build_dir}/mrbgems"
@cc = Command::Compiler.new(self, %w(.c))
@cxx = Command::Compiler.new(self, %w(.cc .cxx .cpp))
@objc = Command::Compiler.new(self, %w(.m))