mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
73b4152574
Previously, `libmruby.a` was created even if only `mruby-bin-mrbc` or` mruby-compiler` was specified for gem, but by specifying `disable_libmruby`, the creation of `libmruby.a` can be suppressed. ### Note The https://github.com/mruby/mruby/pull/5084#issuecomment-723521971 incompatibility seems to be difficult for users to avoid, so the original behavior has been restored. Therefore, if we need `mrbc` other than the `host` build, we need to explicitly specify `mruby-bin-mrbc` gem. Due to the above changes, `build_config/boxing.rb` etc. will not work, but I have added` mruby-bin-mrbc` to `default.gembox` to fix it. I don't think this change is a big deal because originally `mruby-compiler` was included.
31 lines
1.1 KiB
Ruby
31 lines
1.1 KiB
Ruby
MRuby.each_target do
|
|
file libmruby_core_static => libmruby_core_objs.flatten do |t|
|
|
archiver.run t.name, t.prerequisites
|
|
end
|
|
|
|
next unless libmruby_enabled?
|
|
|
|
file libmruby_static => libmruby_objs.flatten do |t|
|
|
archiver.run t.name, t.prerequisites
|
|
end
|
|
|
|
file "#{build_dir}/lib/libmruby.flags.mak" => [__FILE__, libmruby_static] do |t|
|
|
mkdir_p File.dirname t.name
|
|
open(t.name, 'w') do |f|
|
|
f.puts "MRUBY_CFLAGS = #{cc.all_flags}"
|
|
|
|
gem_flags = gems.map { |g| g.linker.flags }
|
|
gem_library_paths = gems.map { |g| g.linker.library_paths }
|
|
f.puts "MRUBY_LDFLAGS = #{linker.all_flags(gem_library_paths, gem_flags)} #{linker.option_library_path % "#{build_dir}/lib"}"
|
|
|
|
gem_flags_before_libraries = gems.map { |g| g.linker.flags_before_libraries }
|
|
f.puts "MRUBY_LDFLAGS_BEFORE_LIBS = #{[linker.flags_before_libraries, gem_flags_before_libraries].flatten.join(' ')}"
|
|
|
|
gem_libraries = gems.map { |g| g.linker.libraries }
|
|
f.puts "MRUBY_LIBS = #{linker.option_library % 'mruby'} #{linker.library_flags(gem_libraries)}"
|
|
|
|
f.puts "MRUBY_LIBMRUBY_PATH = #{libmruby_static}"
|
|
end
|
|
end
|
|
end
|