Referencing (antlr) generated header files from another target's $DERIVED_FILES_DIR
Referencing (antlr) generated header files from another target's $DERIVED_FILES_DIR
- Subject: Referencing (antlr) generated header files from another target's $DERIVED_FILES_DIR
- From: Luke Evans <email@hidden>
- Date: Wed, 18 Mar 2009 03:10:51 -0700
Hello xcoders,
I've just set up a project that will build an Antlr parser from a .g
file.
It occurred to me that this was best done with a second target called
"Grammar" for building the .g file (using the C language target), so I
created this and made the main target dependent on it.
I added a .g rule in my "Grammar" target that calls antlr with the .g
file, placing the output in $DERIVED_FILES_DIR and projecting the
generated .c file back to the project system (all as per the xcode
docs).
Up to here things seem to work nicely. However, now my question:
What's the 'right' way to make reference to the generated files (from
the "Grammar" target) in the code of the main target? While the
generated .c file is compiled by the Grammar target, I need to include
the generated .h file in code compiled by the main target.
The location of this file is somewhat deep in the murky depths of the
build hierarchy (e.g. .../MyProject/build/MyProject.build/Debug/
Grammar.build/DerivedSources) and doesn't seem to be visible by
default on the include path.
Presumably, there is some way to get a particular target's
$DERIVED_FILES_DIR onto the general project include path (or some
additional search path for the main target if such a thing exists)?
Clearly, this search path should involve some symbol whose value would
change if the overall project build location was changed, as
$DERIVED_FILES_DIR would, except that the symbol would need to be
specific to a named target.
I suppose another approach would be to arrange for the headers to be
copied from the $DERIVED_FILES_DIR of the Grammar target to the
general source directory, but this doesn't seem like a good solution.
Cheers
Luke
_______________________________________________
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