diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-01-06 17:14:12 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-01-06 17:14:12 +0900 |
| commit | 8e048ae25db2c00e983bb75f915058844a50c0cb (patch) | |
| tree | 4dbf22f15e482bf082712286bcf0daa5e51aa41c /tasks/toolchains/visualcpp.rake | |
| parent | 1341e53961b3e99ac67d803e5ead677e976d18c4 (diff) | |
| parent | 74c9502bd45fd70926c86ce564c2d5d1df9a6dd0 (diff) | |
| download | mruby-8e048ae25db2c00e983bb75f915058844a50c0cb.tar.gz mruby-8e048ae25db2c00e983bb75f915058844a50c0cb.zip | |
Merge branch 'shuujii-improve-source-scanning-for-presym'
Diffstat (limited to 'tasks/toolchains/visualcpp.rake')
| -rw-r--r-- | tasks/toolchains/visualcpp.rake | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/tasks/toolchains/visualcpp.rake b/tasks/toolchains/visualcpp.rake index 5094495e3..00e364082 100644 --- a/tasks/toolchains/visualcpp.rake +++ b/tasks/toolchains/visualcpp.rake @@ -1,25 +1,21 @@ MRuby::Toolchain.new(:visualcpp) do |conf, _params| - conf.cc do |cc| - cc.command = ENV['CC'] || 'cl.exe' - # C4013: implicit function declaration - cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /we4013 /Zi /MD /O2 /D_CRT_SECURE_NO_WARNINGS)] - cc.defines = %w(MRB_STACK_EXTEND_DOUBLING) - cc.option_include_path = %q[/I"%s"] - cc.option_define = '/D%s' - cc.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"] - cc.cxx_compile_flag = '/TP' - cc.cxx_exception_flag = '/EHs' - end - - conf.cxx do |cxx| - cxx.command = ENV['CXX'] || 'cl.exe' - cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(/c /nologo /W3 /Zi /MD /O2 /EHs /D_CRT_SECURE_NO_WARNINGS)] - cxx.defines = %w(MRB_STACK_EXTEND_DOUBLING) - cxx.option_include_path = %q[/I"%s"] - cxx.option_define = '/D%s' - cxx.compile_options = %Q[%{flags} /Fo"%{outfile}" "%{infile}"] - cxx.cxx_compile_flag = '/TP' - cxx.cxx_exception_flag = '/EHs' + compiler_flags = %w(/nologo /W3 /MD /O2 /D_CRT_SECURE_NO_WARNINGS) + [conf.cc, conf.cxx].each do |compiler| + if compiler == conf.cc + compiler.command = ENV['CC'] || 'cl.exe' + # C4013: implicit function declaration + compiler.flags = [*(ENV['CFLAGS'] || compiler_flags + %w(/we4013))] + else + compiler.command = ENV['CXX'] || 'cl.exe' + compiler.flags = [*(ENV['CXXFLAGS'] || ENV['CFLAGS'] || compiler_flags + %w(/EHs))] + end + compiler.defines = %w(MRB_STACK_EXTEND_DOUBLING) + compiler.option_include_path = %q[/I"%s"] + compiler.option_define = '/D%s' + compiler.compile_options = %Q[/Zi /c /Fo"%{outfile}" %{flags} "%{infile}"] + compiler.preprocess_options = %Q[/EP %{flags} "%{infile}" > "%{outfile}"] + compiler.cxx_compile_flag = '/TP' + compiler.cxx_exception_flag = '/EHs' end conf.linker do |linker| |
