mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5977 from dearblue/setup_debug
Make `MRuby::Build#enable_debug` compiler flag setting abstract
This commit is contained in:
+1
-3
@@ -167,9 +167,7 @@ module MRuby
|
|||||||
def enable_debug
|
def enable_debug
|
||||||
compilers.each do |c|
|
compilers.each do |c|
|
||||||
c.defines += %w(MRB_DEBUG)
|
c.defines += %w(MRB_DEBUG)
|
||||||
if toolchains.any? { |toolchain| toolchain == "gcc" }
|
c.setup_debug(self)
|
||||||
c.flags += %w(-g3 -O0)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
@mrbc.compile_options += ' -g'
|
@mrbc.compile_options += ' -g'
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,12 @@ module MRuby
|
|||||||
def object_ext?(path)
|
def object_ext?(path)
|
||||||
File.extname(path) == build.exts.object
|
File.extname(path) == build.exts.object
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This method can be redefined as a singleton method where appropriate.
|
||||||
|
# Manipulate `flags`, `include_paths` and/or more if necessary.
|
||||||
|
def setup_debug(conf)
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Command::Linker < Command
|
class Command::Linker < Command
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ MRuby::Toolchain.new(:gcc) do |conf, params|
|
|||||||
compiler.cxx_compile_flag = '-x c++ -std=gnu++03'
|
compiler.cxx_compile_flag = '-x c++ -std=gnu++03'
|
||||||
compiler.cxx_exception_flag = '-fexceptions'
|
compiler.cxx_exception_flag = '-fexceptions'
|
||||||
compiler.cxx_invalid_flags = c_mandatory_flags + cxx_invalid_flags
|
compiler.cxx_invalid_flags = c_mandatory_flags + cxx_invalid_flags
|
||||||
|
|
||||||
|
def compiler.setup_debug(conf)
|
||||||
|
self.flags << %w(-g3 -O0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
conf.linker do |linker|
|
conf.linker do |linker|
|
||||||
|
|||||||
Reference in New Issue
Block a user