Xcode: LLVM 7.0: Disable warning “Umbrella header for module does not include header”

廉价感情. 提交于 2019-12-21 07:45:32

问题


In order for my Objective-C framework to link successfully in my Swift cocoa touch framework, I had to use this unpretty workaround, which involves importing all framework headers into the project as public headers.

I totally don't need all of them appearing in my umbrella header, so I want to somehow remove the bunch of warnings generated. ("Umbrella header for module 'Foo' does not include header"). I went through LLVM warning settings in the build settings, but could not found it.


回答1:


If you're getting this warning from a “Compile Swift source files” ▸ “Precompile bridging header” build step (also labeled PrecompileSwiftBridgingHeader), here's how you suppress it:

  1. Find the Build Settings for your project.
  2. Search for “Other Swift Flags”.
  3. Add -Xcc and -Wno-incomplete-umbrella to “Other Swift Flags” (in that order).




回答2:


The warning flag is -Wincomplete-umbrella, so to suppress, pass -Wno-incomplete-umbrella.




回答3:


Try setting the header role from public to project and make sure that you don't reference any third-party headers from your own headers - only from implementations.

Any header that is of role public must be imported into the umbrella header.



来源:https://stackoverflow.com/questions/31508434/xcode-llvm-7-0-disable-warning-umbrella-header-for-module-does-not-include-he

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!