helix/ruby/Rakefile

39 lines
1000 B
Ruby

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rake/extensiontask"
verbose(!!ENV['VERBOSE'])
Rake::ExtensionTask.new do |ext|
ext.name = "native"
ext.ext_dir = "ext/helix_runtime/native"
ext.lib_dir = "lib/helix_runtime"
end
if RUBY_PLATFORM =~ /mingw/
Rake::Task["compile:native:#{RUBY_PLATFORM}"].enhance do
mkdir_p "#{__dir__}/windows_build"
sh "lib.exe /def:#{File.expand_path("ext/helix_runtime/native/native.def", __dir__)} " \
"/out:#{File.expand_path("windows_build/helix-runtime.lib", __dir__)}"
# Windows looks for a .dll in PATH
cp "#{__dir__}/lib/helix_runtime/native.so", "#{__dir__}/windows_build/helix-runtime.dll"
end
CLOBBER.include("windows_build")
end
Rake::ExtensionTask.new do |ext|
ext.name = "dummy"
ext.ext_dir = "spec/support/dummy/ext/dummy"
ext.lib_dir = "spec/support/dummy/lib"
end
RSpec::Core::RakeTask.new(:rspec) do |t|
t.verbose = false
end
task :rspec => :compile
task :default => :rspec