summaryrefslogtreecommitdiffhomepage
path: root/tasks/toolchains/visualcpp.rake
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-11-22 14:06:45 -0800
committerYukihiro "Matz" Matsumoto <[email protected]>2013-11-22 14:06:45 -0800
commita2e0c6ea3a104510ad3a5ecc0ee0f96297f6a550 (patch)
treecc04c4c905274741aed27ee20ae2f5b957a47a9e /tasks/toolchains/visualcpp.rake
parentcfd975037c0b154f31ff50acd871670973da7eaf (diff)
parent172cd281ba221e02ef293f85d25ebe7caed8f314 (diff)
downloadmruby-a2e0c6ea3a104510ad3a5ecc0ee0f96297f6a550.tar.gz
mruby-a2e0c6ea3a104510ad3a5ecc0ee0f96297f6a550.zip
Merge pull request #1592 from perlun/auto-toolchain
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.rake44
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