1 | MRuby::Toolchain.new(:visualcpp) do |conf|
|
---|
2 | conf.cc do |cc|
|
---|
3 | cc.command = ENV['CC'] || 'cl.exe'
|
---|
4 | cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W4 /GS /analyze- /Zc:wchar_t /ZI /Gm /Od /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /EHsc /DWIN32 /D_DEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)]
|
---|
5 | cc.flags << %w(/we4002 /we4003 /we4005 /we4007 /we4010 /we4013 /we4015 /we4020 /we4022 /we4024 /we4028 /we4029 /we4031 /we4033 /we4034 /we4042 /we4047 /we4048 /we4049 /we4056 /we4067 /we4074 /we4079 /we4083 /we4088 /we4089 /we4090 /we4091 /we4094 /we4096 /we4098 /we4099 /we4113 /we4133 /we4715 /we4716)
|
---|
6 | cc.flags << %w(/wd4214 /wd4100 /wd4996)
|
---|
7 | cc.flags << "/Fd\"#{conf.build_dir}\\vc140.pdb\""
|
---|
8 | cc.flags << "/Fp\"%{outdir}\\%{outfilebase}.pch\""
|
---|
9 | cc.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING)
|
---|
10 | cc.option_include_path = '/I%s'
|
---|
11 | cc.option_define = '/D%s'
|
---|
12 | cc.compile_options = "%{flags} /Fo%{outfile} %{infile}"
|
---|
13 | end
|
---|
14 |
|
---|
15 | conf.cxx do |cxx|
|
---|
16 | cxx.command = ENV['CXX'] || 'cl.exe'
|
---|
17 | cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W4 /GS /analyze- /Zc:wchar_t /ZI /Gm /Od /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /Oy- /MDd /EHsc /DWIN32 /D_DEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)]
|
---|
18 | cxx.flags << %w(/we4002 /we4003 /we4005 /we4007 /we4010 /we4013 /we4015 /we4020 /we4022 /we4024 /we4028 /we4029 /we4031 /we4033 /we4034 /we4042 /we4047 /we4048 /we4049 /we4056 /we4067 /we4074 /we4079 /we4083 /we4088 /we4089 /we4090 /we4091 /we4094 /we4096 /we4098 /we4099 /we4113 /we4133 /we4715 /we4716)
|
---|
19 | cxx.flags << %w(/wd4214 /wd4100 /wd4996)
|
---|
20 | cxx.flags << "/Fd\"#{conf.build_dir}\\vc140.pdb\""
|
---|
21 | cxx.flags << "/Fp\"%{outdir}\\%{outfilebase}.pch\""
|
---|
22 | cxx.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING)
|
---|
23 | cxx.option_include_path = '/I%s'
|
---|
24 | cxx.option_define = '/D%s'
|
---|
25 | cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}"
|
---|
26 | end
|
---|
27 |
|
---|
28 | conf.linker do |linker|
|
---|
29 | linker.command = ENV['LD'] || 'link.exe'
|
---|
30 | linker.flags = [ENV['LDFLAGS'] || %w(/MANIFEST /NXCOMPAT /DYNAMICBASE /MACHINE:X86 /INCREMENTAL /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1)]
|
---|
31 | linker.flags << "/PDB:\"#{conf.build_dir}\\vc140.pdb\""
|
---|
32 | #linker.flags << "/PGD:\"%{outdir}\\%{outfilebase}.pgd\""
|
---|
33 | linker.flags << "/ManifestFile:\"%{outdir}\\%{outfilebase}.exe.intermediate.manifest\""
|
---|
34 | linker.libraries = %w()
|
---|
35 | linker.library_paths = %w()
|
---|
36 | linker.option_library = '%s.lib'
|
---|
37 | linker.option_library_path = '/LIBPATH:%s'
|
---|
38 | linker.link_options = "%{flags} /OUT:%{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}"
|
---|
39 | end
|
---|
40 |
|
---|
41 | conf.archiver do |archiver|
|
---|
42 | archiver.command = ENV['AR'] || 'lib.exe'
|
---|
43 | archiver.archive_options = '/nologo /OUT:%{outfile} %{objs}'
|
---|
44 | end
|
---|
45 |
|
---|
46 | conf.yacc do |yacc|
|
---|
47 | yacc.command = ENV['YACC'] || 'bison.exe'
|
---|
48 | yacc.compile_options = '-o %{outfile} %{infile}'
|
---|
49 | end
|
---|
50 |
|
---|
51 | conf.gperf do |gperf|
|
---|
52 | gperf.command = 'gperf.exe'
|
---|
53 | gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
|
---|
54 | end
|
---|
55 |
|
---|
56 | conf.exts do |exts|
|
---|
57 | exts.object = '.obj'
|
---|
58 | exts.executable = '.exe'
|
---|
59 | exts.library = '.lib'
|
---|
60 | end
|
---|
61 |
|
---|
62 | conf.file_separator = '\\'
|
---|
63 | end
|
---|