How to deal with #include <dir/header.h> that doesn't match filesystem layout?
How to deal with #include <dir/header.h> that doesn't match filesystem layout?
- Subject: How to deal with #include <dir/header.h> that doesn't match filesystem layout?
- From: Jens Alfke <email@hidden>
- Date: Wed, 10 Jul 2013 14:14:45 -0700
I’m adding the YAJL library to my project, as a git submodule, and trying to import its headers in my source files. The immediate problem I’m running into is getting the compiler to be able to find the damn headers.
The YAJL headers all start with:
#include <yajl/yajl_common.h>
The source layout in my repo looks like
vendor/
yajl/
src/
api/
yajl_common.h
I cannot figure out how to configure the target’s Header Search Paths to get those #includes to resolve.
The roadblock I’m hitting is that it appears that an include path of the form <dir/file.h> requires that there be a header search-path directory containing a subdirectory named “dir” containing a file “file.h”. But in this case the parent directory of the headers is named “api” not “yajl”. Is there any way around this?
Yes, I could run the makefile for yajl, which would probably create an output directory containing the headers in the right layout. But that would require that I either make people run a makefile after checkout out my repo, or add yet another Xcode target to run a script to invoke the makefile, or check the generated yajl stuff directly into my repo. I would rather not do any of these.
(I’ve run into similar issues in many forms in the past — i.e. the disconnect between the <framework/header.h> C syntax and the actual way the headers are laid out in the source tree. It can be really f’ing frustrating to deal with.)
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden