From 1a1f834adeb243c5938604eb826c65d1f0efede0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 28 Feb 2017 23:27:13 +0900 Subject: Compile C files by C compiler when C++ files mixed. ref #3267 #3470 By this commit, mruby do not use C++ ABI mode unless you specify explicitly. It compiles C files by C compilers, with C++ exception enabled when it sees C++ files in your configured mrbgems. I haven't tried visualcpp, so please submit an issue if you see any problem with C++ gems on Windows. --- tasks/toolchains/gcc.rake | 2 ++ tasks/toolchains/visualcpp.rake | 2 ++ 2 files changed, 4 insertions(+) (limited to 'tasks/toolchains') diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake index 59ae015ac..f370c0abf 100644 --- a/tasks/toolchains/gcc.rake +++ b/tasks/toolchains/gcc.rake @@ -7,6 +7,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params| cc.option_define = '-D%s' cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' cc.cxx_compile_flag = '-x c++ -std=c++03' + cc.cxx_exception_flag = '-fexceptions' end [conf.cxx].each do |cxx| @@ -17,6 +18,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params| cxx.option_define = '-D%s' cxx.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' cxx.cxx_compile_flag = '-x c++ -std=c++03' + cxx.cxx_exception_flag = '-fexceptions' end conf.linker do |linker| diff --git a/tasks/toolchains/visualcpp.rake b/tasks/toolchains/visualcpp.rake index 5f5bab9c2..5bc24a73a 100644 --- a/tasks/toolchains/visualcpp.rake +++ b/tasks/toolchains/visualcpp.rake @@ -8,6 +8,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf, _params| cc.option_define = '/D%s' cc.compile_options = "%{flags} /Fo%{outfile} %{infile}" cc.cxx_compile_flag = '/TP' + cc.cxx_exception_flag = '/EHs' end conf.cxx do |cxx| @@ -18,6 +19,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf, _params| cxx.option_define = '/D%s' cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}" cxx.cxx_compile_flag = '/TP' + cxx.cxx_exception_flag = '/EHs' end conf.linker do |linker| -- cgit v1.2.3