使Xcode忽略第三方项目中的LLVM构建警告 [英] Make Xcode ignore LLVM build warnings in 3rd party project

查看:67
本文介绍了使Xcode忽略第三方项目中的LLVM构建警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode工作区中有一个第三方项目(这是我的主项目的依赖项),我希望Xcode忽略该第三方项目中的所有构建警告.

I have a third party project in my Xcode workspace (it's a dependency for my main project) and I want Xcode to ignore all build warnings from that third party project.

最好,我想忽略项目中针对Vendor/*组的所有构建警告,因为这是我放置所有第三方代码的地方.

Preferably I'd like to ignore all build warnings for the Vendor/* group in my project since that's where I put all my third party code.

可能吗?

推荐答案

是的,有可能,但前提是您在单独的目标中编译了第三方文件.这样,您可以设置不同的编译器标志.

Yes, it's possible, but only if you compile the third-party files in a separate target. This way, you can set different compiler flags.

假设您的主要目标是应用程序.您定义了构建设置以及编译器警告标志.

Let's say your main target is an application. You defined your build settings, as well as the compiler warning flags.

现在您要使用一些第三方资源.您将它们导入到项目中,但是它们会生成警告.您当然可以更改主要目标的设置,但是我敢肯定您想保留自己的设置.

Now you want to use some third-party sources. You import them into your project, but they generate warning. You could of course change your main target's settings, but I'm pretty sure you want to keep your own settings.

只需在您的项目中创建一个附加目标,它是一个静态库. 从您的主要目标中删除第三方文件,并将其添加到库中.

Simply create an additional target in your project, which is a static library. Removes the third-party files from your main target, and add them to the library.

在主要目标的构建阶段,将您的应用程序与静态库链接.

In your main target's build phases, link your application with the static library.

这样,您将能够在应用程序中使用第三方代码,同时为第三方代码设置不同的编译器设置.

This way, you'll be able to use the third-party code in your application, while having different compiler settings for third-party code.

这篇关于使Xcode忽略第三方项目中的LLVM构建警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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