-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathesp32_build_config.rb
72 lines (56 loc) · 1.76 KB
/
esp32_build_config.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
MRuby::Build.new do |conf|
toolchain :gcc
[conf.cc, conf.objc, conf.asm].each do |cc|
cc.command = 'gcc'
cc.flags = [%w(-g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wwrite-strings)]
end
conf.cxx do |cxx|
cxx.command = 'g++'
cxx.flags = [%w(-g -O3 -Wall -Werror-implicit-function-declaration)]
end
conf.linker do |linker|
linker.command = 'gcc'
linker.flags = [%w()]
linker.libraries = %w(m)
linker.library_paths = []
end
conf.archiver do |archiver|
archiver.command = "ar"
end
conf.gembox 'default'
end
MRuby::CrossBuild.new('esp32') do |conf|
toolchain :gcc
conf.cc do |cc|
if ENV["COMPONENT_INCLUDES"]
cc.include_paths << ENV["COMPONENT_INCLUDES"].split(';')
end
cc.flags << '-Wno-maybe-uninitialized'
cc.flags << '-Wno-char-subscripts'
cc.flags << '-Wno-pointer-sign'
cc.flags << '-ffunction-sections'
cc.flags << '-fdata-sections'
cc.flags << '-fstrict-volatile-bitfields'
cc.flags << '-mlongcalls'
cc.flags.reject!{ |x| x == '-MP' }
cc.defines << %w(MRB_HEAP_PAGE_SIZE=64)
cc.defines << %w(MRB_USE_IV_SEGLIST)
cc.defines << %w(KHASH_DEFAULT_SIZE=8)
cc.defines << %w(MRB_STR_BUF_MIN_SIZE=20)
cc.defines << %w(MRB_GC_STRESS)
cc.defines << %w(ESP_PLATFORM)
cc.defines << %w(ESP32)
end
conf.cxx do |cxx|
cxx.include_paths = conf.cc.include_paths.dup
cc.flags.reject!{ |x| x == '-MP' }
cxx.defines = conf.cc.defines.dup
end
conf.bins = []
conf.build_mrbtest_lib_only
conf.disable_cxx_exception
conf.gem :core => "mruby-print"
conf.gem :core => "mruby-compiler"
conf.gem :github => "mruby-esp32/mruby-esp32-system"
conf.gem :github => "mruby-esp32/mruby-esp32-wifi"
end