this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Refactor mruby build configuration sets

+31 -29
+4 -3
CMakeLists.txt
··· 238 238 set(MRUBY_DIR ${THIRDPARTY_DIR}/mruby) 239 239 if(EMSCRIPTEN) 240 240 set(MRUBY_TARGET wasm) 241 - set(MRUBY_CONFIG ${CMAKE_SOURCE_DIR}/tic_mruby_wasm_build_config.rb) 242 241 else() 243 242 set(MRUBY_TARGET host) 244 - set(MRUBY_CONFIG ${CMAKE_SOURCE_DIR}/tic_mruby_build_config.rb) 245 243 endif() 244 + set(MRUBY_CONFIG ${CMAKE_SOURCE_DIR}/mruby/tic_mruby_${MRUBY_TARGET}_build_config.rb) 246 245 set(MRUBY_LIBRARIES ${MRUBY_DIR}/build/${MRUBY_TARGET}/lib/libmruby.a) 247 246 248 247 ExternalProject_Add(mruby_vendor 249 248 SOURCE_DIR ${MRUBY_DIR} 250 249 CONFIGURE_COMMAND "" 251 250 BUILD_IN_SOURCE TRUE 252 - BUILD_COMMAND ${RAKE} MRUBY_CONFIG=${MRUBY_CONFIG} 251 + BUILD_COMMAND ${CMAKE_COMMAND} -E env 252 + "BUILD_TYPE=${CMAKE_BUILD_TYPE}" 253 + ${RAKE} MRUBY_CONFIG=${MRUBY_CONFIG} 253 254 INSTALL_COMMAND "" 254 255 BUILD_BYPRODUCTS ${MRUBY_LIBRARIES} 255 256 )
+1
mruby/.gitignore
··· 1 + *.lock
tic.gembox mruby/tic.gembox
+19 -25
tic_mruby_build_config.rb mruby/tic_mruby_host_build_config.rb
··· 2 2 # load specific toolchain settings 3 3 conf.toolchain 4 4 5 - # Use mrbgems 6 - # conf.gem 'examples/mrbgems/ruby_extension_example' 7 - # conf.gem 'examples/mrbgems/c_extension_example' do |g| 8 - # g.cc.flags << '-g' # append cflags in this gem 9 - # end 10 - # conf.gem 'examples/mrbgems/c_and_ruby_extension_example' 11 - # conf.gem :core => 'mruby-eval' 12 - # conf.gem :mgem => 'mruby-onig-regexp' 13 - # conf.gem :github => 'mattn/mruby-onig-regexp' 14 - # conf.gem :git => 'git@github.com:mattn/mruby-onig-regexp.git', :branch => 'master', :options => '-v' 15 - 16 5 # include the GEM box 17 6 conf.gembox File.expand_path('tic', File.dirname(__FILE__)) 18 7 19 8 # C compiler settings 20 9 conf.cc do |cc| 21 - # cc.command = ENV['CC'] || 'gcc' 22 - cc.flags = [ENV['CFLAGS'] || %w()] 23 10 cc.flags << '-fPIC' unless ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 24 - # cc.include_paths = ["#{root}/include"] 25 - # cc.defines = %w() 26 - # cc.option_include_path = %q[-I"%s"] 27 - # cc.option_define = '-D%s' 28 - # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"] 11 + 12 + case ENV['BUILD_CONFIG'].upcase 13 + when /DEBUG/ 14 + unless ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 15 + cc.flags << '-g' 16 + end 17 + else 18 + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 19 + cc.flags << '/O1' 20 + else 21 + cc.flags << '-Os' 22 + end 23 + end 29 24 end 30 25 31 26 # mrbc settings ··· 65 60 # end 66 61 67 62 # file extensions 68 - # conf.exts do |exts| 69 - # exts.object = '.o' 70 - # exts.executable = '' # '.exe' if Windows 71 - # exts.library = '.a' 72 - # end 73 - conf.exts.library = '.a' 63 + conf.exts do |exts| 64 + exts.object = '.o' 65 + exts.library = '.a' 66 + # exts.executable = '' # '.exe' if Windows 67 + end 74 68 75 69 # file separator 76 70 # conf.file_separator = '/' 77 71 78 72 # Turn on `enable_debug` for better debugging 79 - # conf.enable_debug 73 + conf.enable_debug if /DEBUG/ =~ ENV['BUILD_CONFIG'].upcase 80 74 conf.enable_bintest 81 75 conf.enable_test 82 76 end
+7 -1
tic_mruby_wasm_build_config.rb mruby/tic_mruby_wasm_build_config.rb
··· 14 14 conf.gembox File.expand_path('tic', File.dirname(__FILE__)) 15 15 16 16 conf.cc do |cc| 17 - cc.flags = [ENV['CFLAGS'] || %w()] 17 + case ENV['BUILD_CONFIG'].upcase 18 + when /DEBUG/ 19 + cc.flags << '-g' 20 + else 21 + cc.flags << '-Os' 22 + end 18 23 end 19 24 25 + conf.enable_debug if /DEBUG/ =~ ENV['BUILD_CONFIG'].upcase 20 26 conf.enable_bintest 21 27 conf.enable_test 22 28 end