Commit cd554f43 authored by Samuel Giddins's avatar Samuel Giddins

Ensure static library module maps are declared as [system]

This is to mirror our use of -isystem for header search paths, making it so that headers imported via <> have warnings supressed
parent 4508097f
...@@ -67,7 +67,7 @@ module Pod ...@@ -67,7 +67,7 @@ module Pod
# #
def generate def generate
<<-MODULE_MAP.strip_heredoc <<-MODULE_MAP.strip_heredoc
#{module_specifier_prefix}module #{target.product_module_name} { #{module_specifier_prefix}module #{target.product_module_name}#{module_declaration_attributes} {
#{headers.join("\n ")} #{headers.join("\n ")}
export * export *
...@@ -88,6 +88,15 @@ module Pod ...@@ -88,6 +88,15 @@ module Pod
'' ''
end end
end end
# The suffix attributes to `module`.
# Ensures that library module maps are treated as `system` modules,
# supressing warnings when imported, as is done for header imports given via `-isystem`.
#
def module_declaration_attributes
return '' if target.requires_frameworks?
' [system]'
end
end end
end end
end end
...@@ -622,7 +622,7 @@ module Pod ...@@ -622,7 +622,7 @@ module Pod
UI.message "- Copying module map file to #{UI.path(path)}" do UI.message "- Copying module map file to #{UI.path(path)}" do
contents = custom_module_map.read contents = custom_module_map.read
unless target.requires_frameworks? unless target.requires_frameworks?
contents.gsub!(/^(\s*)framework\s+module/, '\1module') contents.gsub!(/^(\s*)framework\s+(module [^{}]){/, '\1\2 [system] {')
end end
generator = Generator::Constant.new(contents) generator = Generator::Constant.new(contents)
update_changed_file(generator, path) update_changed_file(generator, path)
......
...@@ -27,7 +27,7 @@ module Pod ...@@ -27,7 +27,7 @@ module Pod
@pod_target.stubs(:requires_frameworks?).returns(false) @pod_target.stubs(:requires_frameworks?).returns(false)
@gen.save_as(path) @gen.save_as(path)
path.read.should == <<-EOS.strip_heredoc path.read.should == <<-EOS.strip_heredoc
module BananaLib { module BananaLib [system] {
umbrella header "BananaLib-umbrella.h" umbrella header "BananaLib-umbrella.h"
export * export *
......
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