-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
42 lines (34 loc) · 971 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/extensiontask"
spec = Gem::Specification.load("mayu-swc.gemspec")
spec.requirements.clear
spec.required_ruby_version = nil
spec.required_rubygems_version = nil
spec.extensions.clear
spec.files -= Dir["ext/**/*"]
Rake::ExtensionTask.new("ext", spec) do |ext|
ext.lib_dir = "lib/mayu/swc"
ext.ext_dir = "ext"
ext.cross_compile = true
ext.cross_platform = [
"x86_64-linux",
"aarch64-linux",
"x86_64-darwin",
"arm64-darwin",
]
end
Gem::PackageTask.new(spec) do |pkg|
end
desc "Build native extension for a given platform (i.e. `rake 'native[x86_64-linux]'`)"
task :native, [:platform] do |_t, platform:|
sh "bundle", "exec", "rb-sys-dock", "--platform", platform, "--build"
end
require "minitest/test_task"
Minitest::TestTask.create(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.warning = false
t.test_globs = ["test/**/*_test.rb"]
end
task default: :test