LoginSignup
3
3

More than 5 years have passed since last update.

mruby-cliのクロスコンパイル

Last updated at Posted at 2016-02-07

参考

準備

プロジェクト作成
mruby-cli --setup test1
コンパイラの取得
git clone git@github.com:hone/mruby-cli.git
cd mruby-cli.git
docker-compose run compile

初回は時間がかかるが二回目以降は早い。

バイナリ
$ find mruby/build | grep bin\/
./mruby/build/i686-w64-mingw32/bin/test1.exe
./mruby/build/i686-pc-linux-gnu/bin/test1
./mruby/build/x86_64-apple-darwin14/bin/test1
./mruby/build/x86_64-pc-linux-gnu/bin/test1
./mruby/build/i386-apple-darwin14/bin/test1
./mruby/build/x86_64-w64-mingw32/bin/test1.exe

編集

mrblib/test1.rb
 def __main__(argv)
   if argv[1] == "version"
     puts "v#{Test1::VERSION}"
   else
-    puts "Hello World"
+    puts "Hello 日本語"
   end
 end
$ docker-compose run compiler
$ ./mruby/build/x86_64-pc-linux-gnu/bin/test1
Hello 日本語
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3