Skip navigation.
 
mlRe: Problem when inheriting settings in xcconfig files
FROM : Mattias Arrelid
DATE : Fri Jan 18 22:44:06 2008

On 12/12/07, Chris Hanson <<email_removed>> wrote:
> On Dec 11, 2007, at 4:49 AM, Mattias Arrelid wrote:
>
> > I have a project which defines the build and target settings through
> > xcconfig files. Now, I would like to define other linker flags in
> > the top level root xcconfig file, and re-use these in other xcconfig
> > files that includes this xcconfig file. Like...
>
> This is an Xcode question and thus would be best asked on the xcode-
> users list.  Thanks.
>
> > root.xcconfig:
> > OTHER_LDFLAGS = -framework Carbon
> >
> > using_root_as_base.xcconfig:
> >
> > #include "root.xcconfig"
> > OTHER_LDFLAGS = -framework Cocoa $(OTHER_LDFLAGS)
> >
> > Why doesn't the above work as expected?
>
> Because each included xcconfig file doesn't define a "level" of
> configuration.  In other words, the #include directive is text-
> substitution just as it is in C, not file-referencing.  So your
> using_root_as_base.xcconfig is exactly equivalent to the following text:
>
> OTHER_LDFLAGS = -framework Carbon
> OTHER_LDFLAGS = -framework Cocoa $(OTHER_LDFLAGS)
>
> This defines OTHER_LDFLAGS, and then defines OTHER_LDFLAGS *again* to
> reference the value at the next level of the build settings stack.  It
> doesn't define two levels of build settings stack.
>
>    -- Chris


That seems reasonable. And thanks for pointing me in the xcode-users
mailing list direction (never thought of such a list, how clumsy of
me).

Regards
Mattias

Related mailsAuthorDate
mlProblem when inheriting settings in xcconfig files Mattias Arrelid Dec 11, 13:49
mlRe: Problem when inheriting settings in xcconfig files Jonathan del Strot… Dec 11, 13:55
mlRe: Problem when inheriting settings in xcconfig files Jean-Daniel Dupas Dec 11, 13:58
mlRe: Problem when inheriting settings in xcconfig files Mattias Arrelid Dec 11, 14:24
mlRe: Problem when inheriting settings in xcconfig files Chris Hanson Dec 12, 11:09
mlRe: Problem when inheriting settings in xcconfig files Mattias Arrelid Jan 18, 22:44