mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
build system: remove dead presym_enabled? checks
Since presym is now always enabled, the @enable_presym flag, presym_enabled? method, and all conditional branches guarding presym-specific code paths are dead code. Remove them and simplify the affected build logic. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
+4
-9
@@ -134,7 +134,6 @@ module MRuby
|
||||
@enable_bintest = false
|
||||
@enable_test = false
|
||||
@enable_lock = true
|
||||
@enable_presym = true
|
||||
@enable_benchmark = true
|
||||
@mrbcfile_external = false
|
||||
@internal = internal
|
||||
@@ -158,7 +157,7 @@ module MRuby
|
||||
if current.libmruby_enabled? && !current.mrbcfile_external?
|
||||
current.create_mrbc_build if current.host? || current.gems["mruby-bin-mrbc"]
|
||||
end
|
||||
current.presym = Presym.new(current) if current.presym_enabled?
|
||||
current.presym = Presym.new(current)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -184,10 +183,6 @@ module MRuby
|
||||
@enable_debug = true
|
||||
end
|
||||
|
||||
def presym_enabled?
|
||||
@enable_presym
|
||||
end
|
||||
|
||||
def disable_lock
|
||||
@enable_lock = false
|
||||
end
|
||||
@@ -258,7 +253,7 @@ module MRuby
|
||||
if cxx_src
|
||||
obj ||= cxx_src + @exts.object
|
||||
dsts = [obj]
|
||||
dsts << (cxx_src + @exts.presym_preprocessed) if presym_enabled?
|
||||
dsts << (cxx_src + @exts.presym_preprocessed)
|
||||
defines = []
|
||||
include_paths = ["#{MRUBY_ROOT}/src", *includes]
|
||||
dsts.each do |dst|
|
||||
@@ -372,7 +367,7 @@ EOS
|
||||
end
|
||||
[@cc, *(@cxx if cxx_exception_enabled?)].each do |compiler|
|
||||
compiler.define_rules(@build_dir, MRUBY_ROOT, @exts.object)
|
||||
compiler.define_rules(@build_dir, MRUBY_ROOT, @exts.presym_preprocessed) if presym_enabled?
|
||||
compiler.define_rules(@build_dir, MRUBY_ROOT, @exts.presym_preprocessed)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -558,7 +553,7 @@ EOS
|
||||
end
|
||||
build.build_mrbc_exec
|
||||
build.disable_libmruby
|
||||
build.presym = Presym.new(build) if build.presym_enabled?
|
||||
build.presym = Presym.new(build)
|
||||
@mrbc_build = build
|
||||
self.mrbcfile = build.mrbcfile
|
||||
build
|
||||
|
||||
+2
-2
@@ -96,7 +96,7 @@ module MRuby
|
||||
|
||||
def setup_compilers
|
||||
(core? ? [@cc, *(@cxx if build.cxx_exception_enabled?)] : compilers).each do |compiler|
|
||||
compiler.define_rules build_dir, @dir, @build.exts.presym_preprocessed if build.presym_enabled?
|
||||
compiler.define_rules build_dir, @dir, @build.exts.presym_preprocessed
|
||||
compiler.define_rules build_dir, @dir, @build.exts.object
|
||||
compiler.defines << %Q[MRBGEM_#{funcname.upcase}_VERSION=#{version}]
|
||||
compiler.include_paths << "#{@dir}/include" if File.directory? "#{@dir}/include"
|
||||
@@ -119,7 +119,7 @@ module MRuby
|
||||
end
|
||||
|
||||
def cdump?
|
||||
build.presym_enabled? && @cdump
|
||||
@cdump
|
||||
end
|
||||
|
||||
def core?
|
||||
|
||||
+3
-14
@@ -7,13 +7,6 @@ MRuby.each_target do
|
||||
self.libmruby_objs << objfile(src.ext)
|
||||
|
||||
file src => [mrbcfile, __FILE__, *rbfiles] do |t|
|
||||
if presym_enabled?
|
||||
cdump = true
|
||||
suffix = "proc"
|
||||
else
|
||||
cdump = false
|
||||
suffix = "irep"
|
||||
end
|
||||
mkdir_p File.dirname(t.name)
|
||||
File.open(t.name, 'w') do |f|
|
||||
_pp "GEN", "mrblib/*.rb", "#{t.name.relative_path}"
|
||||
@@ -24,16 +17,12 @@ MRuby.each_target do
|
||||
f.puts %Q[ * This file was generated!]
|
||||
f.puts %Q[ * All manual changes will get lost.]
|
||||
f.puts %Q[ */]
|
||||
unless presym_enabled?
|
||||
f.puts %Q[#include <mruby.h>]
|
||||
f.puts %Q[#include <mruby/irep.h>]
|
||||
end
|
||||
mrbc.run f, rbfiles, "mrblib_#{suffix}", cdump: cdump, static: true
|
||||
mrbc.run f, rbfiles, "mrblib_proc", cdump: true, static: true
|
||||
f.puts %Q[void]
|
||||
f.puts %Q[mrb_init_mrblib(mrb_state *mrb)]
|
||||
f.puts %Q[{]
|
||||
f.puts %Q[ mrblib_#{suffix}_init_syms(mrb);] if cdump
|
||||
f.puts %Q[ mrb_load_#{suffix}(mrb, mrblib_#{suffix});]
|
||||
f.puts %Q[ mrblib_proc_init_syms(mrb);]
|
||||
f.puts %Q[ mrb_load_proc(mrb, mrblib_proc);]
|
||||
f.puts %Q[}]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,7 +8,6 @@ end
|
||||
|
||||
MRuby.each_target do |build|
|
||||
gensym_task = task(:gensym)
|
||||
next unless build.presym_enabled?
|
||||
|
||||
presym = build.presym
|
||||
|
||||
|
||||
Reference in New Issue
Block a user