summaryrefslogtreecommitdiffhomepage
path: root/ext
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-10-09 15:39:40 -0400
committerTom Black <[email protected]>2016-10-09 15:39:40 -0400
commit4a4234d6e85dcda9a6b25ebf88f60693aded6177 (patch)
tree8c5e174eff02b9210a0979c86ef1040b0e56ac55 /ext
parent922d47027ead7cec732e086880a3a8127c0b8cf6 (diff)
downloadruby2d-4a4234d6e85dcda9a6b25ebf88f60693aded6177.tar.gz
ruby2d-4a4234d6e85dcda9a6b25ebf88f60693aded6177.zip
Update extconf.rb
Bump minimum Simple 2D version required, add install case for Windows / MinGW.
Diffstat (limited to 'ext')
-rw-r--r--ext/ruby2d/extconf.rb19
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')