- Timestamp:
- Jul 9, 2020, 8:51:43 AM (4 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-2.1.1
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-2.1.1/tasks/toolchains/visualcpp.rake
r331 r439 1 1 MRuby::Toolchain.new(:visualcpp) do |conf, _params| 2 conf.file_separator = '\\' 3 2 4 conf.cc do |cc| 3 5 cc.command = ENV['CC'] || 'cl.exe' 4 # C4013: implicit function declaration 5 cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /we4013 /Zi /MD /O2 /utf-8 /D_CRT_SECURE_NO_WARNINGS)] 6 cc.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING) 7 cc.option_include_path = '/I%s' 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"] 8 13 cc.option_define = '/D%s' 9 cc.compile_options = "%{flags} /Fo%{outfile} %{infile}"14 cc.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"] 10 15 cc.cxx_compile_flag = '/TP' 11 16 cc.cxx_exception_flag = '/EHs' … … 14 19 conf.cxx do |cxx| 15 20 cxx.command = ENV['CXX'] || 'cl.exe' 16 cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHs /utf-8 /D_CRT_SECURE_NO_WARNINGS)] 17 cxx.defines = %w(DISABLE_GEMS MRB_STACK_EXTEND_DOUBLING) 18 cxx.option_include_path = '/I%s' 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"] 19 28 cxx.option_define = '/D%s' 20 cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}"29 cxx.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"] 21 30 cxx.cxx_compile_flag = '/TP' 22 31 cxx.cxx_exception_flag = '/EHs' … … 25 34 conf.linker do |linker| 26 35 linker.command = ENV['LD'] || 'link.exe' 27 linker.flags = [ENV['LDFLAGS'] || %w(/MANIFEST /NXCOMPAT /DYNAMICBASE /MACHINE:X86 /INCREMENTAL /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1)] 28 linker.flags << "/PDB:\"#{conf.build_dir}\\vc140.pdb\"" 29 #linker.flags << "/PGD:\"%{outdir}\\%{outfilebase}.pgd\"" 30 linker.flags << "/ManifestFile:\"%{outdir}\\%{outfilebase}.exe.intermediate.manifest\"" 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\""] 31 41 linker.libraries = %w() 32 42 linker.library_paths = %w() 33 43 linker.option_library = '%s.lib' 34 44 linker.option_library_path = '/LIBPATH:%s' 35 linker.link_options = "%{flags} /OUT:%{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}"45 linker.link_options = %Q[%{flags} /OUT:"%{outfile}" %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}] 36 46 end 37 47 38 48 conf.archiver do |archiver| 39 49 archiver.command = ENV['AR'] || 'lib.exe' 40 archiver.archive_options = '/nologo /OUT: %{outfile}%{objs}'50 archiver.archive_options = '/nologo /OUT:"%{outfile}" %{objs}' 41 51 end 42 52 43 53 conf.yacc do |yacc| 44 54 yacc.command = ENV['YACC'] || 'bison.exe' 45 yacc.compile_options = '-o %{outfile} %{infile}'55 yacc.compile_options = %q[-o "%{outfile}" "%{infile}"] 46 56 end 47 57 48 58 conf.gperf do |gperf| 49 59 gperf.command = 'gperf.exe' 50 gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'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}"] 51 61 end 52 62 … … 57 67 end 58 68 59 conf.file_separator = '\\'60 61 if require 'open3'62 Open3.popen3 conf.cc.command do |_, _, e, _|63 if /Version (\d{2})\.\d{2}\.\d{5}/ =~ e.gets && $1.to_i <= 1764 m = "# VS2010/2012 support will be dropped after the next release! #"65 h = "#" * m.length66 puts h, m, h67 end68 end69 end70 71 69 end
Note:
See TracChangeset
for help on using the changeset viewer.