add framework_search_paths property

This commit is contained in:
Watson
2012-10-04 11:35:24 +09:00
parent ee172b48dc
commit 6c43a2807c
3 changed files with 10 additions and 3 deletions

2
NEWS
View File

@@ -14,6 +14,8 @@
appropriate function if raise an Argument Error exception.
* Fixed a bug which fails looking up method when call super from block in
define_method.
* Added `app.framework_search_paths' to configure your app in Rakefile.
This property is used to search the custom framework paths.
= RubyMotion 1.25 =

View File

@@ -370,9 +370,10 @@ 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(init_o, main_o, *config.frameworks_stubs_objects(platform)).map { |x| "\"#{x}\"" }.join(' ')
framework_search_paths = config.framework_search_paths.map { |x| "-F#{File.expand_path(x)}" }.join(' ')
frameworks = config.frameworks_dependencies.map { |x| "-framework #{x}" }.join(' ')
weak_frameworks = config.weak_frameworks.map { |x| "-weak_framework #{x}" }.join(' ')
sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lmacruby-static -lobjc -licucore #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs.map { |x| '-force_load "' + x + '"' }.join(' ')}"
sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lmacruby-static -lobjc -licucore #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs.map { |x| '-force_load "' + x + '"' }.join(' ')}"
main_exec_created = true
end

View File

@@ -48,7 +48,7 @@ module Motion; module Project
end
variable :files, :xcode_dir, :sdk_version, :deployment_target, :frameworks,
:weak_frameworks, :libs, :delegate_class, :name, :build_dir,
:weak_frameworks, :framework_search_paths, :libs, :delegate_class, :name, :build_dir,
:resources_dir, :specs_dir, :identifier, :codesign_certificate,
:provisioning_profile, :device_family, :interface_orientations, :version,
:short_version, :icons, :prerendered_icon, :background_modes, :seed_id,
@@ -64,6 +64,7 @@ module Motion; module Project
@dependencies = {}
@frameworks = ['UIKit', 'Foundation', 'CoreGraphics']
@weak_frameworks = []
@framework_search_paths = []
@libs = []
@delegate_class = 'AppDelegate'
@name = 'Untitled'
@@ -319,7 +320,10 @@ EOS
end
deps << framework
end
deps = deps.uniq.select { |dep| File.exist?(File.join(datadir, 'BridgeSupport', dep + '.bridgesupport')) }
deps.uniq!
if @framework_search_paths.empty?
deps.select! { |dep| File.exist?(File.join(datadir, 'BridgeSupport', dep + '.bridgesupport')) }
end
deps << 'UIAutomation' if spec_mode
deps
end