Skip to content

Commit

Permalink
Support building by Rake
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 23, 2017
1 parent c05be33 commit f93d8e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
Makefile
mkmf.log
/pkg/
/tmp/
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

require "rubygems"
require "bundler/gem_helper"
require "rake/extensiontask"
require "packnga"

base_dir = File.join(File.dirname(__FILE__))
Expand All @@ -28,6 +29,12 @@ end
helper.install
spec = helper.gemspec

Rake::ExtensionTask.new("arrow_nmatrix", spec) do |ext|
ext.ext_dir = "ext/arrow-nmatrix"
ext.cross_platform = ["x86-mingw32", "x64-mingw32"]
ext.cross_compile = true
end

Packnga::DocumentTask.new(spec) do |task|
task.original_language = "en"
task.translate_language = "ja"
Expand Down
1 change: 1 addition & 0 deletions red-arrow-nmatrix.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency("bundler")
spec.add_development_dependency("rake")
spec.add_development_dependency("test-unit")
spec.add_development_dependency("reke-compiler")
spec.add_development_dependency("packnga")
spec.add_development_dependency("kramdown")
end
4 changes: 3 additions & 1 deletion test/run-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

if system("type make > /dev/null")
Dir.chdir(ext_dir) do
system("make -j8 > /dev/null") or exit(false)
if File.exist?("Makefile")
system("make -j8 > /dev/null") or exit(false)
end
end
end

Expand Down

0 comments on commit f93d8e2

Please sign in to comment.