Skip to content

Commit

Permalink
Fix build error
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed Oct 16, 2023
1 parent 9a2b4ed commit 59ba421
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 40 deletions.
6 changes: 2 additions & 4 deletions build_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,19 @@ def build_config(conf, target = nil, strip: false)
if build_targets.include?('windows-amd64')
MRuby::CrossBuild.new('windows-amd64') do |conf|
build_config(conf, 'x86_64-windows', strip: true)
conf.cc.flags << '-lws2_32'
conf.linker.flags << '-lws2_32'

conf.exts do |exts|
exts.object = '.obj'
exts.executable = '.exe'
exts.library = '.lib'
end

crossbuild_root = File.join(build_dir, 'crossbuild')
FileUtils.mkdir_p(crossbuild_root)
crossbuild_lib_path = File.join(crossbuild_root, 'gai_strerror.o')
crossbuild_src_path = File.join(__dir__, 'crossbuild', 'gai_strerror.c')
`#{conf.cc.command} #{conf.cc.flags.join(' ')} -o #{crossbuild_lib_path} -c #{crossbuild_src_path}`
conf.linker.flags << crossbuild_lib_path
conf.linker.flags += [crossbuild_lib_path]
conf.linker.libraries += %w[wsock32 ws2_32]

debug_config(conf)
gem_config(conf)
Expand Down
65 changes: 30 additions & 35 deletions build_config.rb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ mruby:
release_no: 30200
builds:
host:
https://github.com/mattn/mruby-onig-regexp.git:
url: https://github.com/mattn/mruby-onig-regexp.git
branch: master
commit: 074325207f9181ad242ffb8de34072607164f57f
version: 0.0.0
https://github.com/fastly/mruby-optparse.git:
url: https://github.com/fastly/mruby-optparse.git
branch: master
Expand All @@ -34,16 +29,16 @@ builds:
branch: master
commit: 34a477d249b0d21671058be33aa75d04c3e981ba
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/buty4649/mruby-yaml.git:
url: https://github.com/buty4649/mruby-yaml.git
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
linux-amd64:
https://github.com/mattn/mruby-json.git:
url: https://github.com/mattn/mruby-json.git
Expand All @@ -55,11 +50,6 @@ builds:
branch: master
commit: e6397a090d1efe04d5dab57c63897f0d79bbad89
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: fix-build-error-with-mingw
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/IceDragon200/mruby-catch-throw:
url: https://github.com/IceDragon200/mruby-catch-throw
branch: master
Expand All @@ -75,6 +65,11 @@ builds:
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
linux-arm64:
https://github.com/mattn/mruby-json.git:
url: https://github.com/mattn/mruby-json.git
Expand All @@ -86,11 +81,6 @@ builds:
branch: master
commit: e6397a090d1efe04d5dab57c63897f0d79bbad89
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: fix-build-error-with-mingw
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/IceDragon200/mruby-catch-throw:
url: https://github.com/IceDragon200/mruby-catch-throw
branch: master
Expand All @@ -106,6 +96,11 @@ builds:
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
darwin-amd64:
https://github.com/mattn/mruby-json.git:
url: https://github.com/mattn/mruby-json.git
Expand All @@ -117,11 +112,6 @@ builds:
branch: master
commit: e6397a090d1efe04d5dab57c63897f0d79bbad89
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: fix-build-error-with-mingw
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/IceDragon200/mruby-catch-throw:
url: https://github.com/IceDragon200/mruby-catch-throw
branch: master
Expand All @@ -137,6 +127,11 @@ builds:
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
darwin-arm64:
https://github.com/mattn/mruby-json.git:
url: https://github.com/mattn/mruby-json.git
Expand All @@ -148,11 +143,6 @@ builds:
branch: master
commit: e6397a090d1efe04d5dab57c63897f0d79bbad89
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: fix-build-error-with-mingw
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/IceDragon200/mruby-catch-throw:
url: https://github.com/IceDragon200/mruby-catch-throw
branch: master
Expand All @@ -168,6 +158,11 @@ builds:
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
windows-amd64:
https://github.com/mattn/mruby-json.git:
url: https://github.com/mattn/mruby-json.git
Expand All @@ -179,11 +174,6 @@ builds:
branch: master
commit: e6397a090d1efe04d5dab57c63897f0d79bbad89
version: 0.0.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: fix-build-error-with-mingw
commit: ce9bc7a8b4ff11a438c36826ed2c685237c96b05
version: 0.0.0
https://github.com/IceDragon200/mruby-catch-throw:
url: https://github.com/IceDragon200/mruby-catch-throw
branch: master
Expand All @@ -199,3 +189,8 @@ builds:
branch: master
commit: 61387b50f150626a1cab8833545847ccc3d993b6
version: 0.1.0
https://github.com/buty4649/mruby-onig-regexp.git:
url: https://github.com/buty4649/mruby-onig-regexp.git
branch: master
commit: 8066e215327080a24862411353b0efa50409975b
version: 0.0.0
2 changes: 1 addition & 1 deletion mrbgem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ MRuby::Gem::Specification.new('rf') do |spec|
spec.add_dependency mgem, mgem:
end
spec.add_dependency 'mruby-yaml', github: 'buty4649/mruby-yaml'
spec.add_dependency 'mruby-onig-regexp', github: 'buty4649/mruby-onig-regexp', branch: 'fix-build-error-with-mingw'
spec.add_dependency 'mruby-onig-regexp', github: 'buty4649/mruby-onig-regexp'
end

0 comments on commit 59ba421

Please sign in to comment.