diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-24 01:41:06 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-02-24 01:41:06 +0900 |
| commit | 8b29f0d9c1746b2e115fe7039ab92b369acafb42 (patch) | |
| tree | 722337526ef8fb4706175ce834026f7377157849 | |
| parent | 37348c296e18a051097974952931b7e147cfeaea (diff) | |
| parent | 9059b9a3546e514b09f23ac0029c1734638e9785 (diff) | |
| download | mruby-8b29f0d9c1746b2e115fe7039ab92b369acafb42.tar.gz mruby-8b29f0d9c1746b2e115fe7039ab92b369acafb42.zip | |
Merge pull request #1729 from take-cheeze/customizable_build_dir
Make mruby build directory customizable.
| -rw-r--r-- | tasks/mruby_build.rake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index c92400cf9..b7efa96b9 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)) @@ -204,7 +206,7 @@ module MRuby class CrossBuild < Build attr_block %w(test_runner) - def initialize(name, &block) + def initialize(name, build_dir=nil, &block) @test_runner = Command::CrossTestRunner.new(self) super end |
