Fix for compiling mruby as C++ on Visual Studio toolchain

This commit is contained in:
Tomasz Dąbrowski
2016-11-23 11:59:26 +01:00
committed by Yukihiro "Matz" Matsumoto
parent 18757c8f7b
commit 44c3859a97
4 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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)
+2
View File
@@ -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|
+2
View File
@@ -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|