Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support Windows #98

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
os: [linux, darwin]
os: [linux, darwin, windows]
arch: [x86_64, i686, i386, armhf, aarch64]
exclude:
- os: linux
Expand All @@ -37,6 +37,12 @@ jobs:
arch: armhf
- os: darwin
arch: aarch64
- os: windows
arch: i386
- os: windows
arch: armhf
- os: windows
arch: aarch64
fail-fast: false
steps:
- name: Install libraries
Expand Down Expand Up @@ -84,6 +90,14 @@ jobs:
with:
name: mitamae-i386-darwin
path: mitamae-build/
- uses: actions/download-artifact@v1
with:
name: mitamae-x86_64-windows
path: mitamae-build/
- uses: actions/download-artifact@v1
with:
name: mitamae-i686-windows
path: mitamae-build/

- name: Release
run: |
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ DOCKCROSS_TARGETS = %w[
linux-aarch64
darwin-x86_64
darwin-i386
windows-x86_64
windows-i686
]

STRIP_TARGETS = %w[
Expand Down
53 changes: 49 additions & 4 deletions build_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ def gem_config(conf)
# be sure to include this gem (the cli app)
conf.gem File.expand_path(File.dirname(__FILE__))

conf.gem mgem: 'mruby-file-stat', checksum_hash: '2d3ea9b5d59d2b41133228a71c110b75cb30a31e'
conf.gem mgem: 'mruby-hashie', checksum_hash: 'c69255a94debcd641f2087b569f5625509bde698'
conf.gem mgem: 'mruby-open3', checksum_hash: 'b7480b6300a81d0e5fac469a36a383518e3dfc78'
conf.gem mgem: 'mruby-open3', checksum_hash: '5608d98f52303072af0e5ee26a45852e2720ce19'
conf.gem mgem: 'mruby-shellwords', checksum_hash: '2a284d99b2121615e43d6accdb0e4cde1868a0d8'
conf.gem mgem: 'mruby-specinfra', checksum_hash: '6caf46e69238b50054bed78cb86ead49c3b7730c'
conf.gem github: 'k0kubun/mruby-erb', checksum_hash: '978257e478633542c440c9248e8cdf33c5ad2074'
conf.gem github: 'k0kubun/mruby-tempfile', checksum_hash: 'e628c8fcb4bca3f3456640a8b56d1ae98c594e24'
conf.gem github: 'k0kubun/mruby-file-stat', checksum_hash: '13297c3e60d93b0ce763260b9047cac375ea7f12'
conf.gem github: 'k0kubun/mruby-process', checksum_hash: 'd908a208ce6e4b89b9405f63c3580664008fbb0f'
conf.gem github: 'k0kubun/mruby-tempfile', checksum_hash: '26273b9f884bb4c9e58ba83010ccd5b4258fb82e'
conf.gem github: 'mrbgems/mruby-yaml', checksum_hash: '0606652a6e99d902cd3101cf2d757a7c0c37a7fd'
conf.gem github: 'eagletmt/mruby-etc', checksum_hash: 'v0.1.0'
conf.gem github: 'k0kubun/mruby-etc', checksum_hash: '67da23cf58d1010832e41141280e6cba5a926f77'
end

def debug_config(conf)
Expand Down Expand Up @@ -151,3 +152,47 @@ def debug_config(conf)
gem_config(conf)
end
end

if build_targets.include?('windows-x86_64')
MRuby::CrossBuild.new('windows-x86_64') do |conf|
toolchain :gcc

conf.cc.command = 'x86_64-w64-mingw32-gcc'
conf.linker.command = 'x86_64-w64-mingw32-ld'
conf.cxx.command = 'x86_64-w64-mingw32-g++'
conf.archiver.command = 'x86_64-w64-mingw32-gcc-ar'

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

conf.build_target = 'x86_64-pc-linux-gnu'
conf.host_target = 'x86_64-w64-mingw32'

gem_config(conf)
end
end

if build_targets.include?('windows-i686')
MRuby::CrossBuild.new('windows-i686') do |conf|
toolchain :gcc

conf.cc.command = 'i686-w64-mingw32-gcc'
conf.linker.command = 'i686-w64-mingw32-ld'
conf.cxx.command = 'i686-w64-mingw32-g++'
conf.archiver.command = 'i686-w64-mingw32-gcc-ar'

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

conf.build_target = 'i686-pc-linux-gnu'
conf.host_target = 'i686-w64-mingw32'

gem_config(conf)
end
end
3 changes: 3 additions & 0 deletions dockcross/windows-i686/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# k0kubun/mitamae-dockcross:windows-i686
# Using mruby-cli-docker for now. TODO: Use dockcross
FROM hone/mruby-cli
3 changes: 3 additions & 0 deletions dockcross/windows-x86_64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# k0kubun/mitamae-dockcross:windows-x86_64
# Using mruby-cli-docker for now. TODO: Use dockcross
FROM hone/mruby-cli