diff options
| author | Tom Black <[email protected]> | 2018-02-25 17:18:27 -0800 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2018-05-06 16:53:21 -0700 |
| commit | 89b931a9325db2623490bf5f99672213b600e10e (patch) | |
| tree | 443c4e46ea10eee3f8dd07d81429742c656cc92a /bin | |
| parent | 7d3cff5e5d6d53d7f4def94a9dc831e099e03e67 (diff) | |
| download | ruby2d-89b931a9325db2623490bf5f99672213b600e10e.tar.gz ruby2d-89b931a9325db2623490bf5f99672213b600e10e.zip | |
Fix native building of apps
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/ruby2d | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -60,8 +60,8 @@ def make_lib end lib << " -include Ruby2D::DSL -include Ruby2D\n" +include Ruby2D +extend Ruby2D::DSL\n" File.write('build/lib.rb', lib) end @@ -87,13 +87,16 @@ def build_native(rb_file) exit end + # Add debugging information to produce backtrace + if @debug then debug_flag = '-g' end + # Assemble the Ruby 2D library in one `.rb` file and compile to bytecode make_lib - `mrbc -Bruby2d_lib -obuild/lib.c build/lib.rb` + `mrbc #{debug_flag} -Bruby2d_lib -obuild/lib.c build/lib.rb` # Read the provided Ruby source file, copy to build dir and compile to bytecode File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) } - `mrbc -Bruby2d_app -obuild/src.c build/src.rb` + `mrbc #{debug_flag} -Bruby2d_app -obuild/src.c build/src.rb` # Combine contents of C source files and bytecode into one file open('build/app.c', 'w') do |f| @@ -165,13 +168,16 @@ def build_apple(rb_file, device) exit end + # Add debugging information to produce backtrace + if @debug then debug_flag = '-g' end + # Assemble the Ruby 2D library in one `.rb` file and compile to bytecode make_lib - `mrbc -Bruby2d_lib -obuild/lib.c build/lib.rb` + `mrbc #{debug_flag} -Bruby2d_lib -obuild/lib.c build/lib.rb` # Read the provided Ruby source file, copy to build dir and compile to bytecode File.open('build/src.rb', 'w') { |file| file << strip_require(rb_file) } - `mrbc -Bruby2d_app -obuild/src.c build/src.rb` + `mrbc #{debug_flag} -Bruby2d_app -obuild/src.c build/src.rb` # Copy over iOS project FileUtils.cp_r "#{@gem_dir}/assets/#{device}", "build" |
