@@ -21,25 +21,6 @@ Rake::ExtensionTask.new do |ext|
2121 ext . name = SO_NAME
2222 ext . ext_dir = "ext/libxml"
2323 ext . lib_dir = "lib/#{ RUBY_VERSION . sub ( /\. \d +$/ , '' ) } "
24- if RUBY_PLATFORM . match ( /mingw/ )
25- ext . config_options <<
26- if ( dir = ENV [ 'WINDOWS_XML2_INCLUDE' ] )
27- "--with-xml2-include=#{ dir } "
28- else
29- case RUBY_PLATFORM
30- when 'i386-mingw32'
31- '--with-xml2-include=C:/msys64/mingw32/include/libxml2'
32- when 'x64-mingw32'
33- '--with-xml2-include=C:/msys64/mingw64/include/libxml2'
34- when 'x64-mingw-ucrt'
35- '--with-xml2-include=C:/msys64/ucrt64/include/libxml2'
36- else
37- raise "Unknown Windows Ruby, please set ENV['WINDOWS_XML2_INCLUDE']"
38- end
39- end
40- else
41- ext . config_options << '--with-xml2-include=/usr/include/libxml2'
42- end
4324end
4425
4526# Setup generic gem
@@ -49,21 +30,20 @@ Gem::PackageTask.new(spec) do |pkg|
4930end
5031
5132# Setup Windows Gem
52- if RUBY_PLATFORM . match ( /mswin|mingw/ )
53- binaries = ( FileList [ 'lib/**/*.so' ,
54- 'lib/**/*dll' ] )
33+ if RUBY_PLATFORM . match ( /mingw/ )
34+ binaries = ( FileList [ 'lib/**/*.so' ] )
5535
5636 # Windows specification
57- win_spec = spec . clone
58- win_spec . platform = Gem ::Platform ::CURRENT
59- win_spec . files += binaries . to_a
60- win_spec . instance_variable_set ( :@cache_file , nil )
37+ mingw_spec = spec . clone
38+ mingw_spec . platform = Gem ::Platform ::CURRENT
39+ mingw_spec . files += binaries . to_a
40+ mingw_spec . instance_variable_set ( :@cache_file , nil )
6141
6242 # Unset extensions
63- win_spec . extensions = nil
43+ mingw_spec . extensions = nil
6444
6545 # Rake task to build the windows package
66- Gem ::PackageTask . new ( win_spec ) do |pkg |
46+ Gem ::PackageTask . new ( mingw_spec ) do |pkg |
6747 pkg . package_dir = 'pkg'
6848 pkg . need_tar = false
6949 end
0 commit comments