summaryrefslogtreecommitdiffhomepage
path: root/tasks/mruby_build.rake
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/mruby_build.rake')
-rw-r--r--tasks/mruby_build.rake14
1 files changed, 12 insertions, 2 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake
index bd911493d..46459cf6c 100644
--- a/tasks/mruby_build.rake
+++ b/tasks/mruby_build.rake
@@ -113,13 +113,23 @@ module MRuby
@cxx_exception_disabled = true
end
+ def enable_cxx_exception
+ @cxx_exception_disabled = false
+ compilers.each { |c|
+ c.defines += %w(MRB_ENABLE_CXX_EXCEPTION)
+ c.flags << c.cxx_exception_flag
+ }
+ end
+
def cxx_abi_enabled?
@cxx_abi_enabled
end
def enable_cxx_abi
- return if @cxx_exception_disabled or @cxx_abi_enabled
- compilers.each { |c| c.defines += %w(MRB_ENABLE_CXX_EXCEPTION) }
+ return if @cxx_abi_enabled
+ unless @cxx_exception_disabled
+ enable_cxx_exception
+ end
compilers.each { |c| c.flags << c.cxx_compile_flag }
linker.command = cxx.command if toolchains.find { |v| v == 'gcc' }
@cxx_abi_enabled = true