XCode 2.1 debug/release management for juceLib.a


#1

What’s the correct method to use either a debug or release build of the jucelibrary when you’re making debug/release builds. I thought I tried simply linking to the appropriate directory (build/Development or build/Deployment) without having the library actually included in the project. I recall this not working. Is there a way to do this?
Cheers

I’m still an XCode newb. (among other things)


#2

I wish I had a better solution that the current one, but XCode seems determined to always use the same folder for intermediate files regardless of the build type, and linking an app to differently-named libraries depending on whether it’s a debug configuration also seems to be beyond it.

I’m no XCode expert though, so if anyone out there knows tricks to get around this stuff, I’d love to hear about it!


#3

I’ll dink around and see if I can come up with anything when I have time. There is a path for libraries in the Target->GetInfo->Build pane, but not sure if that works or not.


#4

The fact that the debug and release libraries are built in the same place with the same name is not very good (even very bad).

EDITED see my last post with the working solution


#5

EDITED see my last post with a working solution


#6

I know more every minute I guess :slight_smile:

Based on this: http://www.niallmoody.com/ndcplugs/xcodetutorial.htm

I think the simplest solution might be:

put …/…/bin in “Installation Directory” instead of “Installation Build Products Location” (this was a mistake since it is used for install builds, whatever that is…)

In Development put “juced” as the "Product Name"
In Deployment put “juce” as the “Product Name”

EDIT also need to put the relevant macros for each conifugration (i.e. DEBUG/_DEBUG) in the Preprocessor Macros

I tested it and it works although it still build the libraries under build/bin and put an alias under bin but I leave that for you since my project will work with the alias anyway


#7

I’m looking into this at the moment. Building differently-named libs is easy enough, but how are you linking to them from your app? I can’t see a way of making it link to different libs depending on which build configuration is is use.


#8

I didn’t do it yet but probably usgin some “Other link flags” property which is different for debug and release. Hope it is possible to avoid multiple targets


#9

I think I’ve found a pretty good solution for this. I’m using Xcode 2.2.

  • Remove the JUCE library from the “External Frameworks and Libraries” section in your project

-Open the target info

-Select the Build tab

-Select “Linking” from the Collections list

-For each configuation, add the following to “Other Linker Flags”:
Debug: -l Jucedebug
Release: -l Juce

That should do it.

Matt


#10

I used to do it that way, except that it doesn’t take dependencies into account. (Though to be fair it never actually does the dependencies correctly the other way either)


#11

You mean if you change the JUCE library, it doesn’t rebuild the app? Yeah, that’s irritating.

Visual Studio on Windows does the same thing, unless there’s some way to tweak VS that I don’t know. Anyhow, doing it this way beats having separate targets.

I’d certainly be open to a better solution.

Matt


#12

I know am more than 3 years late, but I would like to suggest two option

option 1 :

Add two targets tot he project one for debug which doesn’t support release and another for reease

option 2 :

This is a better option, build juce in two different folder(Debug & Release) with same name and go to target info >> Build tab and select library search path based on whether it is debug or release mode select appropriate folder in the option


#13

I think you must be on a very old version - this has all been sorted out a long time ago!


#14