diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/ruby2d/extconf.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/ext/ruby2d/extconf.rb b/ext/ruby2d/extconf.rb index 0f49a7c..305f5fc 100644 --- a/ext/ruby2d/extconf.rb +++ b/ext/ruby2d/extconf.rb @@ -1,6 +1,6 @@ require 'mkmf' -S2D_VERSION = '0.3.0' # Simple 2D minimum version required +S2D_VERSION = '0.4.1' # Simple 2D minimum version required $errors = [] class String @@ -70,14 +70,23 @@ elsif RUBY_PLATFORM =~ /linux/ end $CFLAGS << ' -std=c99' + +# Windows / MinGW +elsif RUBY_PLATFORM =~ /mingw/ + # Add flags + $CFLAGS << ' -std=c99 -I/usr/local/include' + $LDFLAGS << ' -Dmain=SDL_main -L/usr/local/lib -lmingw32 -lsimple2d -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lopengl32 -lglew32 -mwindows' end -# Simple 2D installed, check version -check_s2d_version +unless RUBY_PLATFORM =~ /mingw/ + # Simple 2D installed, check version + check_s2d_version + + # Add flags + $LDFLAGS << ' ' << `simple2d --libs` +end -# Configure Simple 2D and create Makefile -$LDFLAGS << ' ' << `simple2d --libs` $LDFLAGS.gsub!(/\n/, ' ') # Remove newlines in flags, they cause problems create_makefile('ruby2d/ruby2d') |
