11# Extension tasks and cross-compiling
22
33host = 'i686-w64-mingw32'
4- plat = 'x86 -mingw32'
4+ $ plat = 'i386 -mingw32'
55
6- tmp = "#{ Dir . pwd } /tmp/#{ plat } "
6+ tmp = "#{ Dir . pwd } /tmp/#{ $ plat} "
77toolchain_file = "#{ Dir . pwd } /ext/win.cmake"
88install_dir = "#{ tmp } /install"
99install_dll = "#{ install_dir } /bin/libtag.dll"
@@ -18,7 +18,7 @@ taglib_options = "-DCMAKE_BUILD_TYPE=Release -DWITH_MP4=ON -DWITH_ASF=ON"
1818
1919def 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 )
5858end
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/"
6564end
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
6970file install_dll => [ "#{ tmp } /#{ taglib } " ] do
7071 chdir "#{ tmp } /#{ taglib } " do
0 commit comments