Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Checked in cross-compilation feature (WiP).

  • Loading branch information...
commit 0abc191c2d73ef8173f861a5ef24412b7de4d0bb 1 parent 46be5a3
@luislavena luislavena authored
13 features/cross-compile.feature
@@ -0,0 +1,13 @@
+Feature: Cross-compile C extensions
+ In order to avoid bitching from Windows users
+ As a Ruby developer on Linux
+ I want some rake tasks that take away the pain of compilation
+ Scenario: compile single extension
+ Given that all my source files are in place
+ And I'm running a POSIX operating system
+ And I've installed cross compile toolchain
+ When rake task 'cross compile' is invoked
+ Then rake task 'cross compile' succeeded
+ And binaries for platform 'i386-mingw32' get generated
15 features/step_definitions/cross_compilation.rb
@@ -0,0 +1,15 @@
+# Naive way of looking into platforms, please include others like FreeBSD?
+if RUBY_PLATFORM =~ /linux|darwin/
+ Given %r{^I'm running a POSIX operating system$} do
+ end
+Given %r{^I've cross compile tools installed$} do
+ compiler = 'i586-mingw32msvc-gcc'
+ found = false
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
+ next unless File.exist?(File.join(path, compiler))
+ found = true
+ end
+ raise "Cannot locate '#{compiler}' in the PATH." unless found
Please sign in to comment.
Something went wrong with that request. Please try again.