diff options
| author | Reckordp <[email protected]> | 2020-03-08 14:23:55 +0700 |
|---|---|---|
| committer | Reckordp <[email protected]> | 2020-03-08 14:23:55 +0700 |
| commit | 7c85a1ff073dabb2495e4146032ea54930308623 (patch) | |
| tree | 80cf59e23bb9b600a77e4a2eb355a7ccc00b7ff3 /mrbgems | |
| parent | dd6f5e4607a9a411d1246b9223d46009c29c2219 (diff) | |
| download | mruby-7c85a1ff073dabb2495e4146032ea54930308623.tar.gz mruby-7c85a1ff073dabb2495e4146032ea54930308623.zip | |
Increase flexibility of CrossBuild
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-io/mrbgem.rake | 18 | ||||
| -rw-r--r-- | mrbgems/mruby-socket/mrbgem.rake | 16 |
2 files changed, 29 insertions, 5 deletions
diff --git a/mrbgems/mruby-io/mrbgem.rake b/mrbgems/mruby-io/mrbgem.rake index bd20f6d20..80835df9c 100644 --- a/mrbgems/mruby-io/mrbgem.rake +++ b/mrbgems/mruby-io/mrbgem.rake @@ -7,9 +7,21 @@ MRuby::Gem::Specification.new('mruby-io') do |spec| case RUBY_PLATFORM when /mingw|mswin|msys/ - spec.linker.libraries += ['Ws2_32'] - #spec.cc.include_paths += ["C:/Windows/system/include"] - spec.linker.library_paths += ["C:/Windows/system"] + really_for_window = true + + if build.kind_of?(MRuby::CrossBuild) + if %w(x86_64-w64-mingw32 i686-w64-mingw32).include?(build.host_target) + really_for_window = true + else + really_for_window = false + end + end + + if really_for_window + spec.linker.libraries += ['Ws2_32'] + #spec.cc.include_paths += ["C:/Windows/system/include"] + spec.linker.library_paths += ["C:/Windows/system"] + end end if build.kind_of?(MRuby::CrossBuild) && %w(x86_64-w64-mingw32 i686-w64-mingw32).include?(build.host_target) spec.linker.libraries += ['ws2_32'] diff --git a/mrbgems/mruby-socket/mrbgem.rake b/mrbgems/mruby-socket/mrbgem.rake index 24d6f953d..c538433e9 100644 --- a/mrbgems/mruby-socket/mrbgem.rake +++ b/mrbgems/mruby-socket/mrbgem.rake @@ -8,8 +8,20 @@ MRuby::Gem::Specification.new('mruby-socket') do |spec| # If Windows, use winsock if ( /mswin|mingw|win32/ =~ RUBY_PLATFORM ) then - spec.linker.libraries << "wsock32" - spec.linker.libraries << "ws2_32" + really_for_window = true + + if build.kind_of?(MRuby::CrossBuild) + if %w(x86_64-w64-mingw32 i686-w64-mingw32).include?(build.host_target) + really_for_window = true + else + really_for_window = false + end + end + + if really_for_window + spec.linker.libraries << "wsock32" + spec.linker.libraries << "ws2_32" + end end spec.add_dependency('mruby-io', :core => 'mruby-io') |
