mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2026 from take-cheeze/disable_cxx_exception
Add MRuby::Build#disable_cxx_exception to force C++ ABI disable.
This commit is contained in:
@@ -205,6 +205,16 @@ If you need to enable C++ ABI mode explicity add the following:
|
||||
|
||||
conf.enable_cxx_abi
|
||||
|
||||
#### C++ exception disabling.
|
||||
|
||||
If you need to force C++ exception disable
|
||||
(For example using a compiler option to disable C++ exception)
|
||||
add following:
|
||||
|
||||
conf.disable_cxx_exception
|
||||
|
||||
Note that it must be called before ```enable_cxx_abi``` or ```gem``` method.
|
||||
|
||||
### Debugging mode
|
||||
|
||||
To enable debugging mode add the following:
|
||||
|
||||
@@ -82,6 +82,7 @@ module MRuby
|
||||
@gems, @libmruby = MRuby::Gem::List.new, []
|
||||
@build_mrbtest_lib_only = false
|
||||
@cxx_abi_enabled = false
|
||||
@cxx_exception_disabled = false
|
||||
|
||||
MRuby.targets[@name] = self
|
||||
end
|
||||
@@ -95,12 +96,16 @@ module MRuby
|
||||
@mrbc.compile_options += ' -g'
|
||||
end
|
||||
|
||||
def disable_cxx_exception
|
||||
@cxx_exception_disabled = true
|
||||
end
|
||||
|
||||
def cxx_abi_enabled?
|
||||
@cxx_abi_enabled
|
||||
end
|
||||
|
||||
def enable_cxx_abi
|
||||
return if @cxx_abi_enabled
|
||||
return if @cxx_exception_disabled or @cxx_abi_enabled
|
||||
compilers.each { |c| c.defines += %w(MRB_ENABLE_CXX_EXCEPTION) }
|
||||
linker.command = cxx.command
|
||||
@cxx_abi_enabled = true
|
||||
|
||||
Reference in New Issue
Block a user