From c761aefa58a61b1c7a43f31d4cfa6000c5adcf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 5 Dec 2013 12:18:52 +0100 Subject: [PATCH] [vendor] Ensure that all cflags are properly quoted. Before it looked like the `-isysroot \"#{sdk_path}\"` part of the cflags would terminate the string passed to the `--cflags` option. Now all the contents of the `--cflags` option is quoted using single-quotes instead. --- lib/motion/project/xcode_config.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/motion/project/xcode_config.rb b/lib/motion/project/xcode_config.rb index 28da0e99..593816ee 100644 --- a/lib/motion/project/xcode_config.rb +++ b/lib/motion/project/xcode_config.rb @@ -343,9 +343,10 @@ EOS def gen_bridge_metadata(platform, headers, bs_file, c_flags, exceptions=[]) sdk_path = self.sdk(local_platform) - includes = headers.map { |header| "-I'#{File.dirname(header)}'" }.uniq + includes = ['-I.'] + headers.map { |header| "-I'#{File.dirname(header)}'" }.uniq exceptions = exceptions.map { |x| "\"#{x}\"" }.join(' ') - 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}" + c_flags = "#{c_flags} -isysroot '#{sdk_path}' #{bridgesupport_cflags} -D__STRICT_ANSI__ #{includes.join(' ')}" + sh "RUBYOPT='' '#{File.join(bindir, 'gen_bridge_metadata')}' #{bridgesupport_flags} --cflags \"#{c_flags}\" #{headers.map { |x| "'#{x}'" }.join(' ')} -o '#{bs_file}' #{ "-e #{exceptions}" if exceptions.length != 0}" end def define_global_env_txt