From 4a4234d6e85dcda9a6b25ebf88f60693aded6177 Mon Sep 17 00:00:00 2001 From: Tom Black Date: Sun, 9 Oct 2016 15:39:40 -0400 Subject: Update extconf.rb Bump minimum Simple 2D version required, add install case for Windows / MinGW. --- ext/ruby2d/extconf.rb | 19 ++++++++++++++----- 1 file 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') -- cgit v1.2.3