diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-02-04 15:24:05 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-04 15:24:05 +0900 |
| commit | 6f354322a8c77f07466aacd12d57674ead6726c9 (patch) | |
| tree | 908e38630c96635ecd8153527180bd1d40544320 /lib | |
| parent | c43dd75ea9e2b2f3387e40617d4f4cd86d3841dc (diff) | |
| parent | f92c1f1b7f561c97571f3352e24162914c06852a (diff) | |
| download | mruby-6f354322a8c77f07466aacd12d57674ead6726c9.tar.gz mruby-6f354322a8c77f07466aacd12d57674ead6726c9.zip | |
Merge pull request #5318 from shuujii/fix-breakage-where-builds-except-host-dont-refer-mrbc-in-host
Fix breakage where builds except `host` don't refer` mrbc` in `host`
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mruby/build.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index d6eabd79e..a79732802 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -320,12 +320,16 @@ EOS return @mrbcfile if @mrbcfile gem_name = "mruby-bin-mrbc" - gem = @gems[gem_name] - gem ||= (host = MRuby.targets["host"]) && host.gems[gem_name] - unless gem - fail "external mrbc or mruby-bin-mrbc gem in current('#{@name}') or 'host' build is required" + if (gem = @gems[gem_name]) + @mrbcfile = exefile("#{gem.build.build_dir}/bin/mrbc") + elsif !host? && (host = MRuby.targets["host"]) + if (gem = host.gems[gem_name]) + @mrbcfile = exefile("#{gem.build.build_dir}/bin/mrbc") + elsif host.mrbcfile_external? + @mrbcfile = host.mrbcfile + end end - @mrbcfile = exefile("#{gem.build.build_dir}/bin/mrbc") + @mrbcfile || fail("external mrbc or mruby-bin-mrbc gem in current('#{@name}') or 'host' build is required") end def mrbcfile=(path) |
