From 758cdd5b333adc536d6acefc2b663226536f597c Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Tue, 8 Apr 2014 20:16:18 +0900 Subject: Add MRuby::Build#disable_cxx_exception to force C++ ABI disable. --- tasks/mruby_build.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index 5877c11cd..1de00d496 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -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 -- cgit v1.2.3 From 702cadae4c248334bcc0f842ace2612088000322 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Tue, 8 Apr 2014 20:30:19 +0900 Subject: Add documentation of MRuby::Build#disable_cxx_exception . --- doc/compile/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/compile/README.md b/doc/compile/README.md index a06a6b952..e494591f7 100644 --- a/doc/compile/README.md +++ b/doc/compile/README.md @@ -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: -- cgit v1.2.3