From 1985f1ace98353772c5fefcb668ab3c0b78c6e54 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Sat, 1 Mar 2014 17:47:21 +0900 Subject: fix compile error of min/max macro --- build_config.rb | 21 +++++++++++++++++++++ src/mruby_core.rake | 3 +++ 2 files changed, 24 insertions(+) diff --git a/build_config.rb b/build_config.rb index e8d07769d..f76e927b4 100644 --- a/build_config.rb +++ b/build_config.rb @@ -4,11 +4,14 @@ MRuby::Build.new do |conf| # Gets set by the VS command prompts. if ENV['VisualStudioVersion'] toolchain :visualcpp + #elsif `uname` =~ /Darwin/ + #toolchain :clang else toolchain :gcc end enable_debug + enable_cxx_abi # Use mrbgems # conf.gem 'examples/mrbgems/ruby_extension_example' @@ -22,6 +25,24 @@ MRuby::Build.new do |conf| # include the default GEMs conf.gembox 'default' + conf.enable_bintest = true + + conf.cc.flags = ['gcc'] + conf.cc.flags # [conf.cc.command] + conf.cc.flags + conf.cc.command = 'ccache' + conf.cc.flags += %w[-O0 -Wall -Wextra -Wno-parentheses-equality -Wdeclaration-after-statement -Werror=declaration-after-statement] + + conf.cxx.flags = [conf.cxx.command] + conf.cxx.flags + conf.cxx.command = 'ccache' + conf.cxx.flags += %w[-O0 -Wall -Wextra -Wno-parentheses-equality -Werror-declaration-after-statement] + + conf.linker.command = 'clang++' + + conf.cc.defines << 'MRB_GC_FIXED_ARENA' # conf.enable_mrbconf :gc_fixed_arena + # conf.gem "#{MRUBY_ROOT}/mruby-uv" + conf.gem "#{MRUBY_ROOT}/mruby-sharedlib" + # conf.gem "#{MRUBY_ROOT}/mruby-onig-regexp" + conf.gem :core => 'mruby-bin-strip' + # C compiler settings # conf.cc do |cc| # cc.command = ENV['CC'] || 'gcc' diff --git a/src/mruby_core.rake b/src/mruby_core.rake index 28ce74e64..7b244c8d3 100644 --- a/src/mruby_core.rake +++ b/src/mruby_core.rake @@ -16,6 +16,9 @@ MRuby.each_target do file src => "#{current_dir}/#{v}.c" do |t| File.open(t.name, 'w') do |f| f.write <