/
build_config.rb
69 lines (54 loc) · 1.39 KB
/
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
CC = `xcrun -find clang`.strip
def sdk_path(device); `xcrun --sdk #{device} --show-sdk-path`.strip end
IOS_FLAGS = %W(-Os -arch armv7 -arch arm64 -isysroot #{sdk_path 'iphoneos'})
IOSSIM_FLAGS = %W(-Os -arch i386 -arch x86_64 -isysroot #{sdk_path 'iphonesimulator'})
TVOS_FLAGS = %W(-Os -arch arm64 -isysroot #{sdk_path 'appletvos'})
TVOSSIM_FLAGS = %W(-Os -arch x86_64 -isysroot #{sdk_path 'appletvsimulator'})
MRuby::Build.new do |conf|
toolchain :clang
conf.gembox 'default'
end
MRuby::CrossBuild.new('ios') do |conf|
conf.gembox 'default'
conf.cc do |cc|
cc.command = CC
cc.flags = IOS_FLAGS
end
conf.linker do |linker|
linker.command = CC
linker.flags = IOS_FLAGS
end
end
MRuby::CrossBuild.new('ios-simulator') do |conf|
conf.gembox 'default'
conf.cc do |cc|
cc.command = CC
cc.flags = IOSSIM_FLAGS
end
conf.linker do |linker|
linker.command = CC
linker.flags = IOSSIM_FLAGS
end
end
MRuby::CrossBuild.new('tvos') do |conf|
conf.gembox 'default'
conf.cc do |cc|
cc.command = CC
cc.flags = TVOS_FLAGS
end
conf.linker do |linker|
linker.command = CC
linker.flags = TVOS_FLAGS
end
end
MRuby::CrossBuild.new('tvos-simulator') do |conf|
conf.gembox 'default'
conf.cc do |cc|
cc.command = CC
cc.flags = TVOSSIM_FLAGS
end
conf.linker do |linker|
linker.command = CC
linker.flags = TVOSSIM_FLAGS
end
end