rework Rakefile.rb to allow cross-compiling from cygwin
This commit is contained in:
parent
d5e7774e3c
commit
4d515297e6
30
Rakefile.rb
30
Rakefile.rb
@ -12,11 +12,31 @@ base_env = Rscons::Environment.new do |env|
|
||||
env["CCFLAGS"] += ["-Wall", "-O2"]
|
||||
env["CFLAGS"] << "-std=gnu99"
|
||||
env["CXXFLAGS"] << "-std=gnu++11"
|
||||
env.parse_flags!("!sdl2-config --cflags --libs")
|
||||
env.parse_flags!("!freetype-config --cflags --libs")
|
||||
env.parse_flags!("!pkg-config --cflags --libs ruby-1.9")
|
||||
env["LIBS"] += ["dl"]
|
||||
if RUBY_PLATFORM =~ /mingw/
|
||||
if RUBY_PLATFORM =~ /cygwin/
|
||||
env["CC"] = "i686-pc-mingw32-gcc"
|
||||
env["CXX"] = "i686-pc-mingw32-g++"
|
||||
ruby_location = ENV["RUBY_PATH"] || "/cygdrive/c/Ruby193"
|
||||
sdl2_location = ENV["SDL2_PATH"] || "/cygdrive/c/apps/SDL2"
|
||||
freetype_location = ENV["FREETYPE_PATH"] || "/cygdrive/c/apps/freetype"
|
||||
env.parse_flags!(<<-EOF)
|
||||
-I#{ruby_location}/include/ruby-1.9.1/i386-mingw32
|
||||
-I#{ruby_location}/include/ruby-1.9.1
|
||||
-L#{ruby_location}/lib
|
||||
-Wl,--enable-auto-image-base,--enable-auto-import
|
||||
-lmsvcrt-ruby191 -lshell32 -lws2_32 -limagehlp -lshlwapi
|
||||
|
||||
-I#{freetype_location}/include/freetype2
|
||||
-L#{freetype_location}/lib -lfreetype
|
||||
|
||||
-I#{sdl2_location}/include -Dmain=SDL_main
|
||||
-L#{sdl2_location}/i686-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
|
||||
EOF
|
||||
else
|
||||
env.parse_flags!("!pkg-config --cflags --libs ruby-1.9")
|
||||
env.parse_flags!("!freetype-config --cflags --libs")
|
||||
env.parse_flags!("!sdl2-config --cflags --libs")
|
||||
end
|
||||
if RUBY_PLATFORM =~ /mingw|cygwin/
|
||||
env["LIBS"] += ["opengl32"]
|
||||
else
|
||||
env["LIBS"] += ["GL"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user