From 993cab49dc64b53d4223bb7351770bf61b349398 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Mon, 21 May 2012 12:33:58 +0200 Subject: [PATCH] use dependencies chain to link with stubs and frameworks --- lib/motion/project/builder.rb | 4 ++-- lib/motion/project/config.rb | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index ed0667f0..65c0b626 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -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 diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 90345bbb..0e2fa706 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -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