summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-03-08 00:01:25 -0500
committerTom Black <[email protected]>2017-03-08 00:01:25 -0500
commit95a9f3b838b47a3507926408f4abe552b6ef8574 (patch)
tree14fb149c5957d391e958d29741d28ef22cc36175
parent7c357dc1ec1673c988a36eddaad73d181f616e82 (diff)
downloadruby2d-95a9f3b838b47a3507926408f4abe552b6ef8574.tar.gz
ruby2d-95a9f3b838b47a3507926408f4abe552b6ef8574.zip
Fix native app compilation with MRuby
Also print clearer error when MRuby does not exist.
-rwxr-xr-xbin/ruby2d11
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/ruby2d b/bin/ruby2d
index b5c862b..d399479 100755
--- a/bin/ruby2d
+++ b/bin/ruby2d
@@ -5,9 +5,8 @@ require 'fileutils'
# Extending `String` to include some fancy colors
class String
def colorize(c); "\e[#{c}m#{self}\e[0m" end
- def bold; colorize('1') end
- def red; colorize('1;31') end
- def red_underline; colorize('4;31') end
+ def bold; colorize('1') end
+ def error; colorize('4;31') end
end
# The installed gem directory
@@ -78,9 +77,7 @@ def build_native(rb_file)
# Check if MRuby exists; if not, quit
if `which mruby`.empty?
- puts "\n#{"mruby".bold} is needed to build native Ruby 2D applications.\n\n",
- " On macOS, install using #{"Homebrew".bold}:",
- " brew install mruby\n\n"
+ puts "#{'Error:'.error} Can't find MRuby, which is needed to build native Ruby 2D applications.\n"
exit
end
@@ -105,7 +102,7 @@ def build_native(rb_file)
end
# Compile to native executable
- `cc -lmruby \`simple2d --libs\` build/app.c -o build/app`
+ `cc build/app.c -lmruby \`simple2d --libs\` -o build/app`
# Success!
puts "Native app created at `build/app`"