Permalink
Browse files

Updated extension tasks to match newer structure.

  • Loading branch information...
1 parent f68f595 commit f8dd52dbd690535888d87f3b84665cb86435a375 @luislavena luislavena committed Mar 3, 2010
Showing with 10 additions and 17 deletions.
  1. +10 −17 tasks/native.rake
View
@@ -1,19 +1,19 @@
# use rake-compiler for building the extension
require 'rake/extensiontask'
-# build sqlite3_api C extension
-Rake::ExtensionTask.new('sqlite3_api', HOE.spec) do |ext|
+# build sqlite3_native C extension
+Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
+ # where to locate the extension
+ ext.ext_dir = 'ext/sqlite3'
+
# reference to the sqlite3 library
sqlite3_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'sqlite3'))
- # define target for extension (supporting fat binaries)
- if RUBY_PLATFORM =~ /mingw/ then
- ruby_ver = RUBY_VERSION.match(/(\d+\.\d+)/)[1]
- ext.lib_dir = "lib/#{ruby_ver}"
- end
-
# automatically add build options to avoid need of manual input
if RUBY_PLATFORM =~ /mswin|mingw/ then
+ # define target for extension (supporting fat binaries)
+ RUBY_VERSION =~ /(\d+\.\d+)/
+ ext.lib_dir = "lib/sqlite3/#{$1}"
ext.config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
else
ext.cross_compile = true
@@ -22,14 +22,7 @@ Rake::ExtensionTask.new('sqlite3_api', HOE.spec) do |ext|
end
end
-# C wrapper depends on swig file to be generated
-file 'ext/sqlite3_api/sqlite3_api_wrap.c' => ['ext/sqlite3_api/sqlite3_api.i'] do |t|
- begin
- sh "swig -ruby -o #{t.name} #{t.prerequisites.first}"
- rescue
- fail "could not build wrapper via swig (perhaps swig is not installed?)"
- end
-end
-
# ensure things are compiled prior testing
task :test => [:compile]
+
+# vim: syntax=ruby

0 comments on commit f8dd52d

Please sign in to comment.