diff options
| author | Per Lundberg <[email protected]> | 2013-11-22 22:17:01 +0200 |
|---|---|---|
| committer | Per Lundberg <[email protected]> | 2013-11-22 22:17:01 +0200 |
| commit | 172cd281ba221e02ef293f85d25ebe7caed8f314 (patch) | |
| tree | 83bf2fe39f5aa3f0a72554fead5e8bac2b134a0f /tasks/toolchains/visualcpp.rake | |
| parent | 07b8a5b0427c21518c7b7cf465197dc310b9d3b0 (diff) | |
| download | mruby-172cd281ba221e02ef293f85d25ebe7caed8f314.tar.gz mruby-172cd281ba221e02ef293f85d25ebe7caed8f314.zip | |
Automatically detect toolchain if it is visualcpp, and hence we drop vs2010.rake altogether - it’s no longer needed.
Diffstat (limited to 'tasks/toolchains/visualcpp.rake')
| -rw-r--r-- | tasks/toolchains/visualcpp.rake | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tasks/toolchains/visualcpp.rake b/tasks/toolchains/visualcpp.rake new file mode 100644 index 000000000..fc51dbc02 --- /dev/null +++ b/tasks/toolchains/visualcpp.rake @@ -0,0 +1,44 @@ +MRuby::Toolchain.new(:visualcpp) do |conf| + [conf.cc, conf.cxx].each do |cc| + cc.command = ENV['CC'] || 'cl.exe' + cc.flags = [ENV['CFLAGS'] || %w(/c /nologo /W3 /D_DEBUG /MDd /Zi /Od /RTC1 /DHAVE_STRING_H /DNO_GETTIMEOFDAY /D_CRT_SECURE_NO_WARNINGS)] + cc.include_paths = ["#{MRUBY_ROOT}/include"] + cc.defines = %w(DISABLE_GEMS) + cc.option_include_path = '/I%s' + cc.option_define = '/D%s' + cc.compile_options = "%{flags} /Fo%{outfile} %{infile}" + end + + conf.linker do |linker| + linker.command = ENV['LD'] || 'link.exe' + linker.flags = [ENV['LDFLAGS'] || %w(/nologo)] + linker.libraries = %w() + linker.library_paths = %w() + linker.option_library = '%s.lib' + linker.option_library_path = '/LIBPATH:%s' + linker.link_options = "%{flags} /OUT:%{outfile} %{objs} %{flags_before_libraries} %{libs} %{flags_after_libraries}" + end + + conf.archiver do |archiver| + archiver.command = ENV['AR'] || 'lib.exe' + archiver.archive_options = '/nologo /OUT:%{outfile} %{objs}' + end + + conf.yacc do |yacc| + yacc.command = ENV['YACC'] || 'bison.exe' + yacc.compile_options = '-o %{outfile} %{infile}' + end + + conf.gperf do |gperf| + gperf.command = 'gperf.exe' + gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}' + end + + conf.exts do |exts| + exts.object = '.obj' + exts.executable = '.exe' + exts.library = '.lib' + end + + conf.file_separator = '\\' +end |
