Skip to content

Commit 62fd44a

Browse files
committed
Check if the toolchain is present before compiling
1 parent 168f5b5 commit 62fd44a

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Rakefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ load "#{mruby_root}/Rakefile"
2222

2323
desc "compile all the binaries"
2424
task :compile => [:all] do
25+
load "#{mruby_root}/test/mrbtest.rake"
26+
MRuby.each_target do |target|
27+
`#{target.cc.command} --version`
28+
abort("Command #{target.cc.command} for #{target.name} is missing.") unless $?.success?
29+
end
2530
%W(#{mruby_root}/build/x86_64-pc-linux-gnu/bin/#{APP_NAME} #{mruby_root}/build/i686-pc-linux-gnu/#{APP_NAME}").each do |bin|
2631
sh "strip --strip-unneeded #{bin}" if File.exist?(bin)
2732
end

mrblib/setup.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ def is_in_a_docker?
319319
320320
desc "compile binary"
321321
task :compile => [:all] do
322+
load "\#{mruby_root}/test/mrbtest.rake"
323+
MRuby.each_target do |target|
324+
`\#{target.cc.command} --version`
325+
abort("Command \#{target.cc.command} for \#{target.name} is missing.") unless $?.success?
326+
end
322327
%W(\#{mruby_root}/build/x86_64-pc-linux-gnu/bin/\#{APP_NAME} \#{mruby_root}/build/i686-pc-linux-gnu/\#{APP_NAME}").each do |bin|
323328
sh "strip --strip-unneeded \#{bin}" if File.exist?(bin)
324329
end

0 commit comments

Comments
 (0)