source: EcnlProtoTool/trunk/mruby-2.1.1/tasks/toolchains/visualcpp.rake@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 3.7 KB
Line 
1MRuby::Toolchain.new(:visualcpp) do |conf, _params|
2 conf.file_separator = '\\'
3
4 conf.cc do |cc|
5 cc.command = ENV['CC'] || 'cl.exe'
6 cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /utf-8 /W4 /GS /analyze- /Zc:wchar_t /Zi /O2 /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /MD /EHsc /DWIN32 /DNDEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)]
7 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)
8 cc.flags << %w(/wd4214 /wd4100 /wd4996)
9 cc.flags << ["/Fd\"#{conf.build_dir.gsub('/', conf.file_separator)}\\vc142.pdb\""]
10 cc.flags << ["/Fp\"%{outdir}\\%{outfilebase}.pch\""]
11 cc.defines = %w(MRB_STACK_EXTEND_DOUBLING)
12 cc.option_include_path = %q[/I"%s"]
13 cc.option_define = '/D%s'
14 cc.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
15 cc.cxx_compile_flag = '/TP'
16 cc.cxx_exception_flag = '/EHs'
17 end
18
19 conf.cxx do |cxx|
20 cxx.command = ENV['CXX'] || 'cl.exe'
21 cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /utf-8 /W4 /GS /analyze- /Zc:wchar_t /Zi /O2 /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /MD /EHsc /DWIN32 /DNDEBUG /D_CONSOLE /D_CRT_SECURE_NO_WARNINGS)]
22 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)
23 cxx.flags << %w(/wd4214 /wd4100 /wd4996)
24 cxx.flags << ["/Fd\"#{conf.build_dir.gsub('/', conf.file_separator)}\\vc142.pdb\""]
25 cxx.flags << ["/Fp\"%{outdir}\\%{outfilebase}.pch\""]
26 cxx.defines = %w(MRB_STACK_EXTEND_DOUBLING)
27 cxx.option_include_path = %q[/I"%s"]
28 cxx.option_define = '/D%s'
29 cxx.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
30 cxx.cxx_compile_flag = '/TP'
31 cxx.cxx_exception_flag = '/EHs'
32 end
33
34 conf.linker do |linker|
35 linker.command = ENV['LD'] || 'link.exe'
36 linker.flags = [ENV['LDFLAGS'] || %w(/MANIFEST /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1)]
37 #linker.flags = [ENV['LDFLAGS'] || %w(/MANIFEST /LTCG:incremental /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1)]
38 #linker.flags << ["/PGD:\"%{outdir}\\%{outfilebase}.pgd\""]
39 linker.flags << ["/PDB:\"#{conf.build_dir.gsub('/', conf.file_separator)}\\vc142.pdb\""]
40 linker.flags << ["/ManifestFile:\"%{outdir}\\%{outfilebase}.exe.intermediate.manifest\""]
41 linker.libraries = %w()
42 linker.library_paths = %w()
43 linker.option_library = '%s.lib'
44 linker.option_library_path = '/LIBPATH:%s'
45 linker.link_options = %Q[%{flags} /OUT:"%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}]
46 end
47
48 conf.archiver do |archiver|
49 archiver.command = ENV['AR'] || 'lib.exe'
50 archiver.archive_options = '/nologo /OUT:"%{outfile}" %{objs}'
51 end
52
53 conf.yacc do |yacc|
54 yacc.command = ENV['YACC'] || 'bison.exe'
55 yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
56 end
57
58 conf.gperf do |gperf|
59 gperf.command = 'gperf.exe'
60 gperf.compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
61 end
62
63 conf.exts do |exts|
64 exts.object = '.obj'
65 exts.executable = '.exe'
66 exts.library = '.lib'
67 end
68
69end
Note: See TracBrowser for help on using the repository browser.