diff options
| author | Tomasz Dąbrowski <[email protected]> | 2016-11-23 11:59:26 +0100 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-24 09:28:00 +0900 |
| commit | 44c3859a9725a5fb41e374ba91b52459498b8f17 (patch) | |
| tree | 3900834fc0f823d6fc73059bee13d6b7a2049913 /tasks | |
| parent | 18757c8f7be05d9bc8d850180ada4d3fa1fc018d (diff) | |
| download | mruby-44c3859a9725a5fb41e374ba91b52459498b8f17.tar.gz mruby-44c3859a9725a5fb41e374ba91b52459498b8f17.zip | |
Fix for compiling mruby as C++ on Visual Studio toolchain
Diffstat (limited to 'tasks')
| -rw-r--r-- | tasks/mruby_build.rake | 2 | ||||
| -rw-r--r-- | tasks/mruby_build_commands.rake | 1 | ||||
| -rw-r--r-- | tasks/toolchains/gcc.rake | 2 | ||||
| -rw-r--r-- | tasks/toolchains/visualcpp.rake | 2 |
4 files changed, 6 insertions, 1 deletions
diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index cde996aae..bd911493d 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -120,7 +120,7 @@ module MRuby def enable_cxx_abi return if @cxx_exception_disabled or @cxx_abi_enabled compilers.each { |c| c.defines += %w(MRB_ENABLE_CXX_EXCEPTION) } - compilers.each { |c| c.flags << '-x c++'} + compilers.each { |c| c.flags << c.cxx_compile_flag } linker.command = cxx.command if toolchains.find { |v| v == 'gcc' } @cxx_abi_enabled = true end diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index f4805f46d..d688077ff 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -41,6 +41,7 @@ module MRuby class Command::Compiler < Command attr_accessor :flags, :include_paths, :defines, :source_exts attr_accessor :compile_options, :option_define, :option_include_path, :out_ext + attr_accessor :cxx_compile_flag def initialize(build, source_exts=[]) super(build) diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake index 4897e8c52..e4680b632 100644 --- a/tasks/toolchains/gcc.rake +++ b/tasks/toolchains/gcc.rake @@ -6,6 +6,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params| cc.option_include_path = '-I%s' cc.option_define = '-D%s' cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' + cc.cxx_compile_flag = '-x c++' end [conf.cxx].each do |cxx| @@ -15,6 +16,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params| cxx.option_include_path = '-I%s' cxx.option_define = '-D%s' cxx.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' + cxx.cxx_compile_flag = '-x c++' end conf.linker do |linker| diff --git a/tasks/toolchains/visualcpp.rake b/tasks/toolchains/visualcpp.rake index 52820656b..5f5bab9c2 100644 --- a/tasks/toolchains/visualcpp.rake +++ b/tasks/toolchains/visualcpp.rake @@ -7,6 +7,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf, _params| cc.option_include_path = '/I%s' cc.option_define = '/D%s' cc.compile_options = "%{flags} /Fo%{outfile} %{infile}" + cc.cxx_compile_flag = '/TP' end conf.cxx do |cxx| @@ -16,6 +17,7 @@ MRuby::Toolchain.new(:visualcpp) do |conf, _params| cxx.option_include_path = '/I%s' cxx.option_define = '/D%s' cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}" + cxx.cxx_compile_flag = '/TP' end conf.linker do |linker| |
