Define a system search path in Xcode 4

I am trying to set the header search path in Xcode 4 (using LLVM 2.0 / clang as a compiler) in a C ++ command line project so that I can include the library header file via #include <foo> .

If I include the search path in the assembly setup of the "Header Search Paths" assembly, then the header is located. Unfortunately, I also compile with -Werror and a strict warning level, and the title in question causes a compilation error.

Therefore, I would include the header search path through -isystem to disable warnings for this library header. However, Im could not find the appropriate build option in Xcode 4. Neither the "Header Search Paths" nor the "User Header Search Paths" work.

Does Xcode support the -isystem flag?

+4
source share
1 answer

As you pointed out, -isystem is a way for gcc process the include dirs system and unlike the -I directories, the -isystem tags will have warnings suppressed, and various other behaviors that you get from the system include paths.

Xcode may not make this obvious, but a gcc-like llvm-based compiler, provided with Xcode 4.3 , supports this function like gcc. This seems to be a common myth that it does not (no doubt because it was not in the past), and even CMake (2.8.7) still continues to avoid using the -isystem option with Xcode.

For those who create Xcode projects manually, the "header search paths" (as opposed to the "User header search paths") in the settings of your project will also work, as you already mentioned, and probably easier t use something like CMake to create your Xcode project.

+3
source

All Articles