Re: How do you build a dependency with a different configuration
Re: How do you build a dependency with a different configuration
- Subject: Re: How do you build a dependency with a different configuration
- From: Walter <email@hidden>
- Date: Wed, 02 Apr 2008 07:39:35 -0400
- Thread-topic: How do you build a dependency with a different configuration
I hope this explains it:
xcodebuild -target MyApp -configuration release
Has a "run script build phase" that calls xcodebuild:
cd otherProject
xcodebuild -target release -configuration Default
When the second xcodebuild command runs, it should be setting environment
variables:
setenv ACTION build
setenv ALWAYS_REZ YES
setenv ALWAYS_SEARCH_USER_PATHS YES
setenv APPLE_INTERNAL_DEVELOPER_DIR /AppleInternal/Developer
setenv APPLE_INTERNAL_DIR /AppleInternal
setenv APPLE_INTERNAL_DOCUMENTATION_DIR /AppleInternal/Documentation
(plus a bunch more more)
These environment variables do not get set when the target that owns the
"run script build phase" is a dependency of the first xcodebuild command.
When the environment variables don't get set, it uses whatever the first
xcodebuild setup as an environment and the dependency fails to build.
I did find a workaround, but would like to be able to build the second
project as a dependency instead of as a two part build. Now I have a
project that doesn't build anything except for dependencies where both
projects are a dependency of the outer project and that seems to work.
Walter
On 4/1/08 6:43 PM, "Chris Espinosa" <email@hidden> wrote:
>
> On Apr 1, 2008, at 1:52 PM, Walter wrote:
>
>> I'd like to build a project dependency that users a different
>> configuration
>> than my base Xcode project.
>
> Unfortunately, Xcode only builds corresponding configurations
> automatically.
>
>> When attempting to build the dependency, Xcode
>> sets environment variables incorrectly causing the build to fail.
>> If I
>> build the dependency manually, the environment variables are set
>> correctly
>> by Xcode and the build succeeds.
>
> Xcode doesn't pass any settings from one build to another, neither
> environment variables nor build settings. (They're different.) Please
> describe exactly what you're experiencing, because building target B
> independently should not be different from building product B as a
> dependency of product A.
>
>> I've tried using a shell script build phase to build the dependency by
>> calling xcodebuild with the proper configuration, but it still fails
>> with
>> incorrect environment variables. It seems that it uses the
>> environment set
>> by the parent build instead of setting up the environment for that
>> specific
>> build and configuration that I've specified.
>
> Again, you'll have to be more specific about what exactly you're
> seeing, because Xcode doesn't do this.
>
>> Does anyone know how to get around this?
>>
>> Is there a way to clear the environment variables set by the parent
>> build
>> before issuing the xcodebuild command?
>
> You can do that (Greg shows you how), but unless we really know what
> you mean that probably won't address your Chris.
>
> Chris
_______________________________________________
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