Make Xcode ignore LLVM build warnings in 3rd party project

前端 未结 4 979
深忆病人
深忆病人 2021-01-18 05:13

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.

4条回答
  •  悲哀的现实
    2021-01-18 05:52

    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.

提交回复
热议问题