mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-24 04:46:05 +08:00
fix a bug where vendor library contained in gem causes a build error with system bundled ruby
http://hipbyte.myjetbrains.com/youtrack/issue/RM-553
This commit is contained in:
@@ -69,12 +69,6 @@ module Motion; module Project;
|
||||
bs_files.concat(vendor_project.bs_files)
|
||||
end
|
||||
|
||||
# Validate common build directory.
|
||||
if !File.directory?(Builder.common_build_dir) or !File.writable?(Builder.common_build_dir)
|
||||
$stderr.puts "Cannot write into the `#{Builder.common_build_dir}' directory, please remove or check permissions and try again."
|
||||
exit 1
|
||||
end
|
||||
|
||||
# Prepare embedded and external frameworks BridgeSupport files (OSX-only).
|
||||
if config.respond_to?(:embedded_frameworks) && config.respond_to?(:external_frameworks)
|
||||
embedded_frameworks = config.embedded_frameworks.map { |x| File.expand_path(x) }
|
||||
@@ -552,6 +546,13 @@ EOS
|
||||
rescue
|
||||
end
|
||||
end
|
||||
|
||||
# Validate common build directory.
|
||||
if !File.directory?(dir) or !File.writable?(dir)
|
||||
$stderr.puts "Cannot write into the `#{dir}' directory, please remove or check permissions and try again."
|
||||
exit 1
|
||||
end
|
||||
|
||||
dir
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,8 +65,7 @@ module Motion; module Project;
|
||||
def build_static(platform, opts)
|
||||
App.info 'Build', @path
|
||||
Dir.chdir(@path) do
|
||||
build_dir = "build-#{platform}"
|
||||
|
||||
build_dir = build_dir(platform)
|
||||
libs = (opts.delete(:products) or Dir.glob('*.a'))
|
||||
source_files = (opts.delete(:source_files) or ['**/*.{c,m,cpp,cxx,mm,h}']).map { |pattern| Dir.glob(pattern) }.flatten
|
||||
cflags = (opts.delete(:cflags) or '')
|
||||
@@ -151,7 +150,7 @@ EOS
|
||||
def build_xcode(platform, opts)
|
||||
project_dir = File.expand_path(@config.project_dir)
|
||||
Dir.chdir(@path) do
|
||||
build_dir = "build-#{platform}"
|
||||
build_dir = build_dir(platform)
|
||||
if !File.exist?(build_dir) or Dir.glob('**/*').any? { |x| File.mtime(x) > File.mtime(build_dir) }
|
||||
FileUtils.mkdir_p build_dir
|
||||
|
||||
@@ -229,6 +228,16 @@ EOS
|
||||
|
||||
private
|
||||
|
||||
def build_dir(platform)
|
||||
@build_dir ||= begin
|
||||
path = "build-#{platform}"
|
||||
unless File.writable?(Dir.pwd)
|
||||
path = File.join(Builder.common_build_dir, @path, path)
|
||||
end
|
||||
path
|
||||
end
|
||||
end
|
||||
|
||||
def gen_method(prefix)
|
||||
method = "#{prefix}_#{@type.to_s}".intern
|
||||
raise "Invalid vendor project type: #{@type}" unless respond_to?(method)
|
||||
|
||||
Reference in New Issue
Block a user