从框架伞头中排除内部头 [英] Excluding internal headers from framework umbrella header

查看:43
本文介绍了从框架伞头中排除内部头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试开始在框架中使用Swift(包括打开模块支持)时,我开始收到如下消息:

While trying to begin using Swift in a framework (including turning on module support), I started getting messages like this:

[snip]/<module-includes>:1:1: Umbrella header for module 'PressKit' does not include header 'NPKBaseAppearance.h'

有问题的标题(大约有十个)未在PressKit.h中列出,但是有充分的理由-它们包括内部的或很少使用的类和类别,我不想向大多数用户公开我的框架.(我想将其中一些暴露在某些特定的地方;其他一些则永远都不要暴露.)

The headers in question (there are about ten of them) are not listed in PressKit.h, but with good reason—they include internal or rarely-used classes and categories that I don't want to expose to most users of my framework. (Some of them I'd like to expose in select places; others should never be exposed.)

将标头标记为私有似乎无济于事.这是对我的框架项目的警告,但是使用该框架的每个目标都出现错误,因此我不能仅仅忽略该问题.

Marking the headers as private doesn't seem to help. This is a warning in my framework's project, but an error in each target using the framework, so I can't just ignore the problem.

很显然,我可以将这些标头添加到我的伞形标头中,但我不想这样做.使用模块时是否违反了框架设计的某些规则?建议如何处理这种情况?

Obviously I can add these headers to my umbrella header, but I don't want to. Am I violating some rule of framework design when using modules? What's the recommended way to handle this sort of situation?

推荐答案

不知道您是否已经自己解决了此问题,但是是否尝试将不想导出的标头排除在自定义.modulemap文件中?

Don't know if you already solved this issue yourself but did you try to exclude the headers you don't want to export in a custom .modulemap file?

看看: Clang 3.7文档-模块

这篇关于从框架伞头中排除内部头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆