Navigation Menu

Skip to content

Commit

Permalink
Don't use current directory for cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 6, 2015
1 parent 08f9b36 commit 18f9002
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Rakefile
Expand Up @@ -17,6 +17,7 @@

require "find"
require "fileutils"
require "shellwords"
require "pathname"
require "erb"
require "yard"
Expand Down Expand Up @@ -157,17 +158,30 @@ namespace :build do
architectures.each do |architecture|
desc "Build gem for Windows #{architecture}"
task architecture do
require "rake_compiler_dock"
rm_rf binary_dir
build_dir = "tmp/windows"
rm_rf build_dir
mkdir_p build_dir

commands = [
"bundle",
"rake clean",
"rake cross native gem RUBY_CC_VERSION=#{ruby_versions}",
["git", "clone", "file://#{Dir.pwd}/.git", build_dir],
["cd", build_dir],
["bundle"],
["rake", "cross", "native", "gem", "RUBY_CC_VERSION=#{ruby_versions}"],
]
if architecture == :x64
commands.unshift("export RROONGA_USE_GROONGA_X64=true")
commands.unshift(["export", "RROONGA_USE_GROONGA_X64=true"])
end
raw_commands = commands.collect do |command|
Shellwords.join(command)
end
RakeCompilerDock.sh(commands.join(" && "))
raw_command_line = raw_commands.join(" && ")

require "rake_compiler_dock"
RakeCompilerDock.sh(raw_command_line)

version = spec.version
cp("#{build_dir}/pkg/rroonga-#{version}-#{architecture}-mingw32.gem",
"pkg/")
end
end
end
Expand Down

0 comments on commit 18f9002

Please sign in to comment.