Created
January 28, 2013 17:57
-
-
Save jinqian/4657640 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_bridge_metadata(headers, bs_file) | |
sdk_path = self.sdk('iPhoneSimulator') | |
includes = headers.map { |header| "-I'#{File.dirname(header)}'" }.uniq | |
a = sdk_version.scan(/(\d+)\.(\d+)/)[0] | |
sdk_version_headers = ((a[0].to_i * 10000) + (a[1].to_i * 100)).to_s | |
extra_flags = OSX_VERSION >= 10.7 ? '--no-64-bit' : '' | |
sh "RUBYOPT='' /usr/bin/gen_bridge_metadata --format complete #{extra_flags} --cflags \"-isysroot #{sdk_path} -miphoneos-version-min=#{sdk_version} -D__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__=#{sdk_version_headers} -I. #{includes.join(' ')}\" #{headers.map { |x| "\"#{x}\"" }.join(' ')} -o \"#{bs_file}\"" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment