Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit d8bb4d1

Browse files
committed
Local changes used to cross-compile the 0.3.19 gem
1 parent 2a01b2b commit d8bb4d1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tasks/compile.rake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
1717
ext.config_options = [ "--with-mysql-dir=#{connector_dir}" ]
1818
else
1919
ext.cross_compile = true
20-
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60', 'x64-mingw32']
20+
ext.cross_platform = ENV['CROSS_PLATFORMS'] ? ENV['CROSS_PLATFORMS'].split(':') : ['x86-mingw32', 'x86-mswin32-60', 'x64-mingw32']
2121
ext.cross_config_options << {
2222
'x86-mingw32' => "--with-mysql-dir=" + File.expand_path("../../vendor/#{vendor_mysql_dir('x86')}", __FILE__),
2323
'x86-mswin32-60' => "--with-mysql-dir=" + File.expand_path("../../vendor/#{vendor_mysql_dir('x86')}", __FILE__),
@@ -87,11 +87,19 @@ else
8787
end
8888
end
8989

90-
desc "Build the windows binary gems per rake-compiler-dock"
90+
desc "Build binary gems for Windows with rake-compiler-dock"
9191
task 'gem:windows' do
9292
require 'rake_compiler_dock'
9393
RakeCompilerDock.sh <<-EOT
94-
bundle install "--without=test benchmarks development rbx" &&
95-
rake cross native gem
94+
bundle install
95+
rake clean
96+
rm vendor/libmysql.dll
97+
rake cross native gem CROSS_PLATFORMS=x86-mingw32:x86-mswin32-60
98+
EOT
99+
RakeCompilerDock.sh <<-EOT
100+
bundle install
101+
rake clean
102+
rm vendor/libmysql.dll
103+
rake cross native gem CROSS_PLATFORMS=x64-mingw32
96104
EOT
97105
end

0 commit comments

Comments
 (0)