Commit d8c67f24 authored by Eloy Durán's avatar Eloy Durán

[xcconfig] Only quote the path to the -isystem option.

parent 76432759
......@@ -46,13 +46,13 @@ module Pod
# @return [Xcodeproj::Config]
#
def generate
header_search_path_flags = target.sandbox.public_headers.search_paths.map { |path| "-isystem #{path}" }
header_search_path_flags = target.sandbox.public_headers.search_paths
@xcconfig = Xcodeproj::Config.new({
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(target.sandbox.public_headers.search_paths),
'PODS_ROOT' => target.relative_pods_root,
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags)
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags, '-isystem')
})
target.pod_targets.each do |pod_target|
......
......@@ -13,10 +13,13 @@ module Pod
# @param [Array<String>] strings
# a list of strings.
#
# @param [String] optional prefix, such as a flag or option.
#
# @return [String] the resulting string.
#
def self.quote(strings)
strings.sort.map { |s| %W|"#{s}"| }.join(" ")
def self.quote(strings, prefix = nil)
prefix = "#{prefix} " if prefix
strings.sort.map { |s| %W|#{prefix}"#{s}"| }.join(" ")
end
# @return [String] the default linker flags. `-ObjC` is always included
......
......@@ -62,7 +62,7 @@ module Pod
end
it 'adds the sandbox public headers search paths to the xcconfig, with quotes, as system headers' do
expected = "$(inherited) \"-isystem #{config.sandbox.public_headers.search_paths.join('" -isystem "')}\""
expected = "$(inherited) -isystem \"#{config.sandbox.public_headers.search_paths.join('" -isystem "')}\""
@xcconfig.to_hash['OTHER_CFLAGS'].should == expected
end
......
......@@ -37,6 +37,11 @@ module Pod
result = @sut.quote(['string1', 'string2'])
result.should == '"string1" "string2"'
end
it "inserts an optional string and then the normal quoted string" do
result = @sut.quote(['string1', 'string2'], '-isystem')
result.should == '-isystem "string1" -isystem "string2"'
end
end
#---------------------------------------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment