diff options
| author | Tom Black <[email protected]> | 2017-03-08 00:01:25 -0500 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2017-03-08 00:01:25 -0500 |
| commit | 95a9f3b838b47a3507926408f4abe552b6ef8574 (patch) | |
| tree | 14fb149c5957d391e958d29741d28ef22cc36175 | |
| parent | 7c357dc1ec1673c988a36eddaad73d181f616e82 (diff) | |
| download | ruby2d-95a9f3b838b47a3507926408f4abe552b6ef8574.tar.gz ruby2d-95a9f3b838b47a3507926408f4abe552b6ef8574.zip | |
Fix native app compilation with MRuby
Also print clearer error when MRuby does not exist.
| -rwxr-xr-x | bin/ruby2d | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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`" |
