[270] | 1 | MRuby::Toolchain.new(:visualcpp) do |conf|
|
---|
| 2 | [conf.cc].each do |cc|
|
---|
| 3 | cc.command = ENV['CC'] || 'cl.exe'
|
---|
| 4 | # C4013: implicit function declaration
|
---|
| 5 | cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /we4013 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)]
|
---|
| 6 | cc.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING)
|
---|
| 7 | cc.option_include_path = '/I%s'
|
---|
| 8 | cc.option_define = '/D%s'
|
---|
| 9 | cc.compile_options = "%{flags} /Fo%{outfile} %{infile}"
|
---|
| 10 | end
|
---|
| 11 |
|
---|
| 12 | [conf.cxx].each do |cxx|
|
---|
| 13 | cxx.command = ENV['CXX'] || 'cl.exe'
|
---|
| 14 | cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHs /D_CRT_SECURE_NO_WARNINGS)]
|
---|
| 15 | cxx.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING)
|
---|
| 16 | cxx.option_include_path = '/I%s'
|
---|
| 17 | cxx.option_define = '/D%s'
|
---|
| 18 | cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}"
|
---|
| 19 | end
|
---|
| 20 |
|
---|
| 21 | conf.linker do |linker|
|
---|
| 22 | linker.command = ENV['LD'] || 'link.exe'
|
---|
| 23 | linker.flags = [ENV['LDFLAGS'] || %w(/NOLOGO /DEBUG /INCREMENTAL:NO /OPT:ICF /OPT:REF)]
|
---|
| 24 | linker.libraries = %w()
|
---|
| 25 | linker.library_paths = %w()
|
---|
| 26 | linker.option_library = '%s.lib'
|
---|
| 27 | linker.option_library_path = '/LIBPATH:%s'
|
---|
| 28 | linker.link_options = "%{flags} /OUT:%{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}"
|
---|
| 29 | end
|
---|
| 30 |
|
---|
| 31 | conf.archiver do |archiver|
|
---|
| 32 | archiver.command = ENV['AR'] || 'lib.exe'
|
---|
| 33 | archiver.archive_options = '/nologo /OUT:%{outfile} %{objs}'
|
---|
| 34 | end
|
---|
| 35 |
|
---|
| 36 | conf.yacc do |yacc|
|
---|
| 37 | yacc.command = ENV['YACC'] || 'bison.exe'
|
---|
| 38 | yacc.compile_options = '-o %{outfile} %{infile}'
|
---|
| 39 | end
|
---|
| 40 |
|
---|
| 41 | conf.gperf do |gperf|
|
---|
| 42 | gperf.command = 'gperf.exe'
|
---|
| 43 | gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
|
---|
| 44 | end
|
---|
| 45 |
|
---|
| 46 | conf.exts do |exts|
|
---|
| 47 | exts.object = '.obj'
|
---|
| 48 | exts.executable = '.exe'
|
---|
| 49 | exts.library = '.lib'
|
---|
| 50 | end
|
---|
| 51 |
|
---|
| 52 | conf.file_separator = '\\'
|
---|
| 53 | end
|
---|