mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-05-16 09:59:39 +08:00
move special configuration for iOS/OSX platform from gen_bridge_metadata()
This commit is contained in:
@@ -178,6 +178,17 @@ module Motion; module Project;
|
||||
ldflags
|
||||
end
|
||||
|
||||
def bridgesupport_flags
|
||||
extra_flags = (OSX_VERSION >= 10.7 && sdk_version < '7.0') ? '--no-64-bit' : ''
|
||||
"--format complete #{extra_flags}"
|
||||
end
|
||||
|
||||
def bridgesupport_cflags
|
||||
a = sdk_version.scan(/(\d+)\.(\d+)/)[0]
|
||||
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s
|
||||
"-miphoneos-version-min=#{sdk_version} -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers}"
|
||||
end
|
||||
|
||||
def device_family_int(family)
|
||||
case family
|
||||
when :iphone then 1
|
||||
|
||||
@@ -103,6 +103,16 @@ module Motion; module Project;
|
||||
super + " -mmacosx-version-min=#{deployment_target}"
|
||||
end
|
||||
|
||||
def bridgesupport_flags
|
||||
"--format complete --64-bit"
|
||||
end
|
||||
|
||||
def bridgesupport_cflags
|
||||
a = sdk_version.scan(/(\d+)\.(\d+)/)[0]
|
||||
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s
|
||||
"-mmacosx-version-min=#{sdk_version} -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=#{sdk_version_headers}"
|
||||
end
|
||||
|
||||
def app_bundle_raw(platform)
|
||||
File.join(versionized_build_dir(platform), bundle_name + '.app')
|
||||
end
|
||||
|
||||
@@ -345,16 +345,7 @@ EOS
|
||||
sdk_path = self.sdk(local_platform)
|
||||
includes = headers.map { |header| "-I'#{File.dirname(header)}'" }.uniq
|
||||
exceptions = exceptions.map { |x| "\"#{x}\"" }.join(' ')
|
||||
a = sdk_version.scan(/(\d+)\.(\d+)/)[0]
|
||||
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s
|
||||
if platform == "MacOSX"
|
||||
extra_flags = '--64-bit'
|
||||
require_version = "-mmacosx-version-min=#{sdk_version} -D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=#{sdk_version_headers}"
|
||||
else
|
||||
extra_flags = (OSX_VERSION >= 10.7 && sdk_version < '7.0') ? '--no-64-bit' : ''
|
||||
require_version = "-miphoneos-version-min=#{sdk_version} -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers}"
|
||||
end
|
||||
sh "RUBYOPT='' '#{File.join(bindir, 'gen_bridge_metadata')}' --format complete #{extra_flags} --cflags \" #{c_flags} -isysroot \"#{sdk_path}\" #{require_version} -D__STRICT_ANSI__ -I. #{includes.join(' ')}\" #{headers.map { |x| "\"#{x}\"" }.join(' ')} -o \"#{bs_file}\" #{ "-e #{exceptions}" if exceptions.length != 0}"
|
||||
sh "RUBYOPT='' '#{File.join(bindir, 'gen_bridge_metadata')}' #{bridgesupport_flags} --cflags \" #{c_flags} -isysroot \"#{sdk_path}\" #{bridgesupport_cflags} -D__STRICT_ANSI__ -I. #{includes.join(' ')}\" #{headers.map { |x| "\"#{x}\"" }.join(' ')} -o \"#{bs_file}\" #{ "-e #{exceptions}" if exceptions.length != 0}"
|
||||
end
|
||||
|
||||
def define_global_env_txt
|
||||
|
||||
Reference in New Issue
Block a user