Ignore:
Timestamp:
Jul 9, 2020, 8:51:43 AM (4 years ago)
Author:
coas-nagasima
Message:

mrubyを2.1.1に更新

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  
    11MRuby::Toolchain.new(:visualcpp) do |conf, _params|
     2  conf.file_separator = '\\'
     3
    24  conf.cc do |cc|
    35    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"]
    813    cc.option_define = '/D%s'
    9     cc.compile_options = "%{flags} /Fo%{outfile} %{infile}"
     14    cc.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
    1015    cc.cxx_compile_flag = '/TP'
    1116    cc.cxx_exception_flag = '/EHs'
     
    1419  conf.cxx do |cxx|
    1520    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"]
    1928    cxx.option_define = '/D%s'
    20     cxx.compile_options = "%{flags} /Fo%{outfile} %{infile}"
     29    cxx.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"]
    2130    cxx.cxx_compile_flag = '/TP'
    2231    cxx.cxx_exception_flag = '/EHs'
     
    2534  conf.linker do |linker|
    2635    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\""]
    3141    linker.libraries = %w()
    3242    linker.library_paths = %w()
    3343    linker.option_library = '%s.lib'
    3444    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}]
    3646  end
    3747
    3848  conf.archiver do |archiver|
    3949    archiver.command = ENV['AR'] || 'lib.exe'
    40     archiver.archive_options = '/nologo /OUT:%{outfile} %{objs}'
     50    archiver.archive_options = '/nologo /OUT:"%{outfile}" %{objs}'
    4151  end
    4252
    4353  conf.yacc do |yacc|
    4454    yacc.command = ENV['YACC'] || 'bison.exe'
    45     yacc.compile_options = '-o %{outfile} %{infile}'
     55    yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
    4656  end
    4757
    4858  conf.gperf do |gperf|
    4959    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}"]
    5161  end
    5262
     
    5767  end
    5868
    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 <= 17
    64         m = "# VS2010/2012 support will be dropped after the next release! #"
    65         h = "#" * m.length
    66         puts h, m, h
    67       end
    68     end
    69   end
    70 
    7169end
Note: See TracChangeset for help on using the changeset viewer.