diff options
| author | take_cheeze <[email protected]> | 2014-02-23 20:33:55 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2014-02-23 20:35:06 +0900 |
| commit | dd68ea979932b77f786424f7c9f65b16a65207b0 (patch) | |
| tree | d96abcafff5d434e606ef0e3b35eaab1f19c88d0 /tasks/mruby_build.rake | |
| parent | e202d4cd530bfc660688da6316e33100b551ed83 (diff) | |
| download | mruby-dd68ea979932b77f786424f7c9f65b16a65207b0.tar.gz mruby-dd68ea979932b77f786424f7c9f65b16a65207b0.zip | |
make mruby build directory customizable
Diffstat (limited to 'tasks/mruby_build.rake')
| -rw-r--r-- | tasks/mruby_build.rake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index c92400cf9..dfc086244 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -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)) |
