Skip to content

Commit 3f014e2

Browse files
committed
Fix cross compilation tasks
Something changed with rake-compiler so that the file now needs to be in a task. Restructure the tasks to do that, which is actually nicer.
1 parent dee1cba commit 3f014e2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tasks/ext.rake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Extension tasks and cross-compiling
22

33
host = 'i686-w64-mingw32'
4-
plat = 'x86-mingw32'
4+
$plat = 'i386-mingw32'
55

6-
tmp = "#{Dir.pwd}/tmp/#{plat}"
6+
tmp = "#{Dir.pwd}/tmp/#{$plat}"
77
toolchain_file = "#{Dir.pwd}/ext/win.cmake"
88
install_dir = "#{tmp}/install"
99
install_dll = "#{install_dir}/bin/libtag.dll"
@@ -18,7 +18,7 @@ taglib_options = "-DCMAKE_BUILD_TYPE=Release -DWITH_MP4=ON -DWITH_ASF=ON"
1818

1919
def configure_cross_compile(ext)
2020
ext.cross_compile = true
21-
ext.cross_platform = 'i386-mingw32'
21+
ext.cross_platform = $plat
2222
ext.cross_config_options.concat($cross_config_options)
2323
ext.cross_compiling do |gem|
2424
gem.files << "lib/libtag.dll"
@@ -57,14 +57,15 @@ Rake::ExtensionTask.new("taglib_wav", $gemspec) do |ext|
5757
configure_cross_compile(ext)
5858
end
5959

60-
task :cross => [:taglib] do
60+
task :cross do
6161
# Mkmf just uses "g++" as C++ compiler, despite what's in rbconfig.rb.
6262
# So, we need to hack around it by setting CXX to the cross compiler.
6363
ENV["CXX"] = "#{host}-g++"
64-
install install_dll, "lib/"
6564
end
6665

67-
task :taglib => [install_dll]
66+
file "tmp/#{$plat}/stage/lib/libtag.dll" => [install_dll] do |f|
67+
install install_dll, f
68+
end
6869

6970
file install_dll => ["#{tmp}/#{taglib}"] do
7071
chdir "#{tmp}/#{taglib}" do

0 commit comments

Comments
 (0)