Xcode 4 + llvm, How to ignore compiler warnings in specific directory?
I'm putting all my third party code in a /Vendor
director开发者_StackOverflow社区y in my Xcode project. How can I suppress all compiler warnings in that directory?
I'm using Xcode 4 and LLVM 2.1.
You cannot set warning flags in Xcode by directory; directories have no meaning to Xcode, they don't form any form of "compile entity". You can set warning flags per Target, per Build Configuration, or on single files. This leaves you with two options:
Build all 3rd party code as an own target, e.g. make it a static library target, then build your code in another target and make it link against the static library of the first target. Each target can then have different warning flags.
Select all the 3rd party files in the list of files to build and override some of the warning flags (if a warning is turned on with
-Wfoobar
, then you can disable it with-Wno-foobar
). Setting compile flags on single files is shown in the screenshot below; this can be done with multiple files at once.
精彩评论