use dependencies chain to link with stubs and frameworks

This commit is contained in:
Laurent Sansonetti
2012-05-21 12:33:58 +02:00
parent 54ea27379b
commit 993cab49dc
2 changed files with 12 additions and 6 deletions

View File

@@ -259,9 +259,9 @@ EOS
or File.mtime(File.join(datadir, platform, 'libmacruby-static.a')) > File.mtime(main_exec)
App.info 'Link', main_exec
objs_list = objs.map { |path, _| path }.unshift(main_o).map { |x| "\"#{x}\"" }.join(' ')
frameworks = config.frameworks.map { |x| "-framework #{x}" }.join(' ')
frameworks = config.frameworks_dependencies.map { |x| "-framework #{x}" }.join(' ')
framework_stubs_objs = []
config.frameworks.each do |framework|
config.frameworks_dependencies.each do |framework|
stubs_obj = File.join(datadir, platform, "#{framework}_stubs.o")
framework_stubs_objs << "\"#{stubs_obj}\"" if File.exist?(stubs_obj)
end

View File

@@ -235,10 +235,10 @@ EOS
end
end
def bridgesupport_files
@bridgesupport_files ||= begin
def frameworks_dependencies
@frameworks_dependencies ||= begin
# Compute the list of frameworks, including dependencies, that the project uses.
deps = ['RubyMotion']
deps = []
slf = File.join(sdk('iPhoneSimulator'), 'System', 'Library', 'Frameworks')
frameworks.each do |framework|
framework_path = File.join(slf, framework + '.framework', framework)
@@ -252,9 +252,15 @@ EOS
end
deps << framework
end
deps.uniq
end
end
def bridgesupport_files
@bridgesupport_files ||= begin
bs_files = []
deps.uniq.each do |framework|
deps = ['RubyMotion'] + frameworks_dependencies
deps.each do |framework|
bs_path = File.join(datadir, 'BridgeSupport', framework + '.bridgesupport')
if File.exist?(bs_path)
bs_files << bs_path