Skip to content

Commit 1985f1a

Browse files
committed
fix compile error of min/max macro
1 parent 87ec256 commit 1985f1a

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

build_config.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
# Gets set by the VS command prompts.
55
if ENV['VisualStudioVersion']
66
toolchain :visualcpp
7+
#elsif `uname` =~ /Darwin/
8+
#toolchain :clang
79
else
810
toolchain :gcc
911
end
1012

1113
enable_debug
14+
enable_cxx_abi
1215

1316
# Use mrbgems
1417
# conf.gem 'examples/mrbgems/ruby_extension_example'
@@ -22,6 +25,24 @@
2225
# include the default GEMs
2326
conf.gembox 'default'
2427

28+
conf.enable_bintest = true
29+
30+
conf.cc.flags = ['gcc'] + conf.cc.flags # [conf.cc.command] + conf.cc.flags
31+
conf.cc.command = 'ccache'
32+
conf.cc.flags += %w[-O0 -Wall -Wextra -Wno-parentheses-equality -Wdeclaration-after-statement -Werror=declaration-after-statement]
33+
34+
conf.cxx.flags = [conf.cxx.command] + conf.cxx.flags
35+
conf.cxx.command = 'ccache'
36+
conf.cxx.flags += %w[-O0 -Wall -Wextra -Wno-parentheses-equality -Werror-declaration-after-statement]
37+
38+
conf.linker.command = 'clang++'
39+
40+
conf.cc.defines << 'MRB_GC_FIXED_ARENA' # conf.enable_mrbconf :gc_fixed_arena
41+
# conf.gem "#{MRUBY_ROOT}/mruby-uv"
42+
conf.gem "#{MRUBY_ROOT}/mruby-sharedlib"
43+
# conf.gem "#{MRUBY_ROOT}/mruby-onig-regexp"
44+
conf.gem :core => 'mruby-bin-strip'
45+
2546
# C compiler settings
2647
# conf.cc do |cc|
2748
# cc.command = ENV['CC'] || 'gcc'

src/mruby_core.rake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ MRuby.each_target do
1616
file src => "#{current_dir}/#{v}.c" do |t|
1717
File.open(t.name, 'w') do |f|
1818
f.write <<EOS
19+
#define __STDC_CONSTANT_MACROS
20+
#define __STDC_LIMIT_MACROS
21+
1922
extern "C" {
2023
#include "#{MRUBY_ROOT}/#{t.prerequisites.first}"
2124
}

0 commit comments

Comments
 (0)