Skip to content

Instantly share code, notes, and snippets.

@jinqian
Created January 28, 2013 17:57
Show Gist options
  • Save jinqian/4657640 to your computer and use it in GitHub Desktop.
Save jinqian/4657640 to your computer and use it in GitHub Desktop.
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