mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-21 10:54:35 +08:00
let the user specify cpu archs
This commit is contained in:
@@ -29,7 +29,7 @@ module Motion; module Project;
|
||||
|
||||
def build(config, platform)
|
||||
datadir = config.datadir
|
||||
archs = config.archs(platform)
|
||||
archs = config.archs[platform]
|
||||
|
||||
ruby = File.join(config.bindir, 'ruby')
|
||||
llc = File.join(config.bindir, 'llc')
|
||||
|
||||
@@ -359,14 +359,20 @@ EOS
|
||||
App.fail "Can't locate compilers for platform `#{platform}'"
|
||||
end
|
||||
|
||||
def archs(platform)
|
||||
Dir.glob(File.join(datadir, platform, '*.bc')).map do |path|
|
||||
path.scan(/kernel-(.+).bc$/)[0][0]
|
||||
def archs
|
||||
@archs ||= begin
|
||||
h = {}
|
||||
%w{iPhoneSimulator iPhoneOS}.each do |platform|
|
||||
h[platform] = Dir.glob(File.join(datadir, platform, '*.bc')).map do |path|
|
||||
path.scan(/kernel-(.+).bc$/)[0][0]
|
||||
end
|
||||
end
|
||||
h
|
||||
end
|
||||
end
|
||||
|
||||
def arch_flags(platform)
|
||||
archs(platform).map { |x| "-arch #{x}" }.join(' ')
|
||||
archs[platform].map { |x| "-arch #{x}" }.join(' ')
|
||||
end
|
||||
|
||||
def common_flags(platform)
|
||||
|
||||
Reference in New Issue
Block a user