native.rake 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # use rake-compiler for building the extension
  2. require 'rake/extensiontask'
  3. # NOTE: version used by cross compilation of Windows native extension
  4. # It do not affect compilation under other operating systems
  5. # The version indicated is the minimum DLL suggested for correct functionality
  6. BINARY_VERSION = "3.7.11"
  7. URL_VERSION = "3071100"
  8. # build sqlite3_native C extension
  9. Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
  10. # where to locate the extension
  11. ext.ext_dir = 'ext/sqlite3'
  12. # where native extension will be copied (matches makefile)
  13. ext.lib_dir = "lib/sqlite3"
  14. # clean binary folders always
  15. CLEAN.include("#{ext.lib_dir}/?.?")
  16. # automatically add build options to avoid need of manual input
  17. if RUBY_PLATFORM =~ /mswin|mingw/ then
  18. # define target for extension (supporting fat binaries)
  19. RUBY_VERSION =~ /(\d+\.\d+)/
  20. ext.lib_dir = "lib/sqlite3/#{$1}"
  21. ext.config_options << "--enable-local"
  22. else
  23. ext.cross_compile = true
  24. ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
  25. ext.cross_config_options << "--enable-local"
  26. end
  27. end
  28. # ensure things are compiled prior testing
  29. task :test => [:compile]
  30. # vim: syntax=ruby