Commit 02d2bb9f authored by swizzlr's avatar swizzlr

Merge pull request #1596 from swizzlr/system_header_warning_inhibition

Inhibit warnings by adding search paths as system headers.
parents 9e71add2 48891df9
...@@ -19,4 +19,4 @@ ...@@ -19,4 +19,4 @@
url = https://github.com/tonymillion/Reachability.git url = https://github.com/tonymillion/Reachability.git
[submodule "spec/cocoapods-integration-specs"] [submodule "spec/cocoapods-integration-specs"]
path = spec/cocoapods-integration-specs path = spec/cocoapods-integration-specs
url = https://github.com/CocoaPods/cocoapods-integration-specs url = https://github.com/CocoaPods/cocoapods-integration-specs.git
...@@ -44,11 +44,13 @@ module Pod ...@@ -44,11 +44,13 @@ module Pod
# @return [Xcodeproj::Config] # @return [Xcodeproj::Config]
# #
def generate def generate
header_search_path_flags = target.sandbox.public_headers.search_paths.map {|path| '-isystem'+path}
@xcconfig = Xcodeproj::Config.new({ @xcconfig = Xcodeproj::Config.new({
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target), 'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(target.sandbox.public_headers.search_paths), 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(target.sandbox.public_headers.search_paths),
'PODS_ROOT' => target.relative_pods_root, 'PODS_ROOT' => target.relative_pods_root,
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1', 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags)
}) })
target.pod_targets.each do |pod_target| target.pod_targets.each do |pod_target|
......
...@@ -55,11 +55,16 @@ module Pod ...@@ -55,11 +55,16 @@ module Pod
@xcconfig.to_hash['PODS_ROOT'].should == '${SRCROOT}/Pods' @xcconfig.to_hash['PODS_ROOT'].should == '${SRCROOT}/Pods'
end end
it 'adds the sandbox public headers search paths to the xcconfig, with quotes' do it 'adds the sandbox public headers search paths to the xcconfig, with quotes, as header search paths' do
expected = "\"#{config.sandbox.public_headers.search_paths.join('" "')}\"" expected = "\"#{config.sandbox.public_headers.search_paths.join('" "')}\""
@xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == expected @xcconfig.to_hash['HEADER_SEARCH_PATHS'].should == expected
end 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"')}\""
@xcconfig.to_hash['OTHER_CFLAGS'].should == expected
end
it 'adds the COCOAPODS macro definition' do it 'adds the COCOAPODS macro definition' do
@xcconfig.to_hash['GCC_PREPROCESSOR_DEFINITIONS'].should.include 'COCOAPODS=1' @xcconfig.to_hash['GCC_PREPROCESSOR_DEFINITIONS'].should.include 'COCOAPODS=1'
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