Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (25 sloc) 0.996 kb
1390e5f @luislavena Cleanup extension building process and dependencies.
luislavena authored
1 # use rake-compiler for building the extension
2 require 'rake/extensiontask'
3
f344924 @luislavena Build sqlite3_api C extension for cross compilation.
luislavena authored
4 # build sqlite3_api C extension
5 Rake::ExtensionTask.new('sqlite3_api', GEM_SPEC) do |ext|
6 # reference to the sqlite3 library
7 sqlite3_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'sqlite3'))
8
9 # automatically add build options to avoid need of manual input
10 if RUBY_PLATFORM =~ /mswin|mingw/ then
11 ext.config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
12 end
13
14 # options for cross compilation
15 if RUBY_PLATFORM !~ /mswin|mingw/ then
16 ext.cross_compile = true
17 ext.cross_platform = 'i386-mswin32'
18 ext.cross_config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
19 end
20 end
1390e5f @luislavena Cleanup extension building process and dependencies.
luislavena authored
21
22 # C wrapper depends on swig file to be generated
23 file 'ext/sqlite3_api/sqlite3_api_wrap.c' => ['ext/sqlite3_api/sqlite3_api.i'] do |t|
24 begin
25 sh "swig -ruby #{t.name} -o #{t.prerequisites.first}"
26 rescue
27 fail "could not build wrapper via swig (perhaps swig is not installed?)"
28 end
29 end
Something went wrong with that request. Please try again.