Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5974583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:57:47+00:00 2026-05-22T20:57:47+00:00

I have a project with one main Cocoa application, a bunch of plugins, and

  • 0

I have a project with one main Cocoa application, a bunch of plugins, and a couple of helper apps. The helper apps have their own targets, and as I want the app build-able without the plugins, the main app has it’s own target (call it AppTarget), but I usually build it all in an Aggregate Target (call it TargetA). I also have another Aggregate Target with TargetA, another plugin, and an additional Copy Files Build Phase (TargetB). This all works as expected. I’m trying to create a new Aggregate Target, TargetC, which contains TargetA, and which will have (but doesn’t yet) have a Run Shell Script Build Phase.

The problem I’m running into is that I’m trying to use GCC_PREPROCESSOR_DEFINITIONS to #define a symbol, TARGETC, for conditional compilation (#ifdef TARGETC … #endif), but it’s not being included in the build parameters when I look in the build log, and the behavior of the app matches the build log — the GCC_PREPROCESSOR_DEFINITIONS failed (I tried both TARGETC and TARGETC=1. I tried adding an OTHER_CFLAGS User-Defined Setting (setting it to -DTARGETC=1), but that didn’t work either.

The documentation says that User-Defined Settings on Aggregate Targets trickle down to their subtargets, but it seems that this only goes down one level – TargetA may be getting it, but the AppTarget sure isn’t. Is this a bug, expected behavior, or am I doing something wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:57:48+00:00Added an answer on May 22, 2026 at 8:57 pm

    I found the answer: this is expected behavior, and furthermore, aggregate targets don’t pass their user settings down to subtargets at all; either the documentation is wrong or I misread it. Which kinda seems to defeat the purpose of having GCC_PREPROCESSOR_DEFINITIONS as a default user setting available for aggregate targets, but c’est la vie.

    To get the behavior I wanted, instead I’m building a separate plugin that will be added to the new aggregate target. I’m using a singleton to load the plugin, which will hold a reference to the principal class in the plugin (typed as id <MyPluginProtocol>), which can be returned to anyone who asks. If the load attempt fails (because the plugin doesn’t exist), it will return nil, so if (nil != [[PluginLoader sharedLoader] plugin]) takes the place of #ifdef TARGETC. It means I don’t get to cut down on shipping code size, but at least it works, and it’s not a waste as I have other code that was going to go into a plugin (just for this target) anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project with two targets, one is a Cocoa Static Library, the
I have a web project that I developed where one of the main functions
When I have one app.config in my main project I always have to duplicate
So for this one project, we have a bunch of queries that are executed
I have a relatively simple goal: I want to create a Cocoa application which
I have a project which has a calling structure similar to this: main project/application
I have create a project with one main form window and also i have
I have started a new project consisting of one main.cpp file and an additional
Underneath one Project in TFS we have multiple products. This is because for us,
I have Midas project that uses a TDataSetProvider in one of RemoteDataModules in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.