diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 33 |
1 files changed, 30 insertions, 3 deletions
@@ -15,6 +15,12 @@ require 'rake/clean' require 'rake/loaders/makefile' +OS = if RUBY_PLATFORM == "x64-mingw32" + :windows +else + :linux +end + OBJ = 'candy_gear' VERSION = '0.1.0' @@ -48,9 +54,20 @@ LIBRARIES = [ 'SDL2_image', 'SDL2_mixer', 'm', - 'vulkan', 'yaml-cpp' ] +case OS +when :windows + LIBRARIES.concat([ + 'SDL2main', + 'mingw32', + 'vulkan-1.dll' + ]) +when :linux + LIBRARIES.concat([ + 'vulkan' + ]) +end CLEAN.include( FileList[ @@ -72,7 +89,10 @@ end # inside the engine to ensure all versions of the engine have precisely the # same features. file MRUBY_STATIC_LIB => ["mruby-#{MRUBY_VERSION}"] do - Dir.chdir("mruby-#{MRUBY_VERSION}") { `rake` } + Dir.chdir("mruby-#{MRUBY_VERSION}") do + ENV['MRUBY_CONFIG'] = '../ruby_build_config.rb' + `rake` + end end task :doc do @@ -109,7 +129,14 @@ end task build: CPP_OBJS + SPV_FILES + [MRUBY_STATIC_LIB] do libs = LIBRARIES.inject('') {_1 + "-l#{_2} "} - system("g++ -o #{OBJ} #{CPP_OBJS} #{MRUBY_STATIC_LIB} #{libs}") + flags = '' + case OS + when :windows + flags = '-w -Wl,-subsystem,windows' + when :linux + end + + system("g++ -o #{OBJ} #{CPP_OBJS} #{MRUBY_STATIC_LIB} #{flags} #{libs}") end task install: :build do |