Commit 2329b178 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1817 from cremno/visualcpp-toolchain-change-cflags

visualcpp toolchain: change compiler/linker flags
parents 00af5efd ab025dc5
MRuby::Toolchain.new(:visualcpp) do |conf|
[conf.cc, conf.cxx].each do |cc|
[conf.cc].each do |cc|
cc.command = ENV['CC'] || 'cl.exe'
cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /D_DEBUG /MDd /Zi /Od /RTC1 /DHAVE_STRING_H /DNO_GETTIMEOFDAY /D_CRT_SECURE_NO_WARNINGS)]
cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)]
cc.include_paths = ["#{MRUBY_ROOT}/include"]
cc.defines = %w(DISABLE_GEMS)
cc.option_include_path = '/I%s'
......@@ -9,9 +9,19 @@ MRuby::Toolchain.new(:visualcpp) do |conf|
cc.compile_options = "%{flags} /Fo%{outfile} %{infile}"
end
[conf.cxx].each do |cxx|
cxx.command = ENV['CXX'] || 'cl.exe'
cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHsc /D_CRT_SECURE_NO_WARNINGS)]
cxx.include_paths = ["#{MRUBY_ROOT}/include"]
cxx.defines = %w(DISABLE_GEMS)
cxx.option_include_path = '/I%s'
cxx.option_define = '/D%s'
cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}"
end
conf.linker do |linker|
linker.command = ENV['LD'] || 'link.exe'
linker.flags = [ENV['LDFLAGS'] || %w(/nologo)]
linker.flags = [ENV['LDFLAGS'] || %w(/NOLOGO /DEBUG /INCREMENTAL:NO /OPT:ICF /OPT:REF)]
linker.libraries = %w()
linker.library_paths = %w()
linker.option_library = '%s.lib'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment