Skip to content

Commit

Permalink
Add support for x64-mingw-ucrt aka RubyInstaller-3.1.0-x64 and parall…
Browse files Browse the repository at this point in the history
…el build
  • Loading branch information
larskanis committed Dec 31, 2021
1 parent 315d66e commit 517b658
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ task 'gem:java' => 'java:gem'

FfiGemHelper.install_tasks
# Register windows gems to be pushed to rubygems.org
Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw32]
Bundler::GemHelper.instance.cross_platforms = %w[x86-mingw32 x64-mingw-ucrt x64-mingw32]

if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
require 'rake/extensiontask'
Expand All @@ -108,11 +108,25 @@ else
end


desc "build a windows gem without all the ceremony"
task "gem:windows" do
require "rake_compiler_dock"
sh "bundle package"
RakeCompilerDock.sh "sudo apt-get update && sudo apt-get install -y libltdl-dev && bundle --local && rake cross native gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=${RUBY_CC_VERSION/:2.2.2/}"
namespace "gem" do
task 'prepare' do
require 'rake_compiler_dock'
sh "bundle package --all"
end

Bundler::GemHelper.instance.cross_platforms.each do |plat|
desc "Build all native binary gems in parallel"
multitask 'native' => plat

desc "Build the native gem for #{plat}"
task plat => 'prepare' do
RakeCompilerDock.sh <<-EOT, platform: plat
sudo apt-get update &&
sudo apt-get install -y libltdl-dev && bundle --local &&
rake cross native gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=${RUBY_CC_VERSION/:2.2.2/}
EOT
end
end
end

directory "ext/ffi_c/libffi"
Expand Down

0 comments on commit 517b658

Please sign in to comment.