简体   繁体   中英

Ignore warnings from framework headers on OS X

When including external library headers in my C++ project I can use -isystem flag instead of -I (at least for GCC or Clang) to mark particular include directory as system libraries directory. This way compiler won't report any warnings regarding the code of external libraries.

Is there any way to do this with OS X framework headers, which are not passed to compiler using -I flags but using -F flag pointing to the directory framework is located in?

Example

Compilation command:

clang++ -F/Users/user/CustomFrameworks -o test.o -c test.cpp

test.cpp

#include <Framework/Header.h>
// ....

Framework structure:

$ ls /Users/user/CustomFrameworks
Framework.framework
$ ls /Users/user/CustomFrameworks/Framework.framework/Headers
Header.h

How to ignore warnings from Header.h ?

If only possible I'd rather not put any compiler-specific pragmas in my code.

Use the -iframework flag. Sometimes reading man-pages helps...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM