Conditional compilation with Xcode

74 Views Asked by At

I am a software developer and I choose Xcode as IDE to do my development. On my Mac I have 10.8 and the latest Xcode available to this OS version.

IIUC, Xcode is just a very powerful wrapper around the basic *nix "configure; make; make install".

With the basic *nix approach it is relatively easy to do a conditional compilation - check if I have an appropriate configure switch and then define an appropriate defines which will be checked during compilation/linking time and/or the run-time.

What I'd like to know is: if it is possible to make something like this with Xcode?

As an example - there are 2 ODBC driver managers: unixODBC and iODBC. iODBC de-jure is the default one, however it is possible to install unixODBC on the Mac. So what I want is to have a "--with-unixodbc"/"--with-iodbc" pair. Also presume I have a library called libodbc_connect.dylib which depends on the driver manager installed and should link to either one based on that switch. And I have the application called db_explorer.

This is just an example, but you should have an idea. Does anyone have a step-by-step instructions on how to do that?

0

There are 0 best solutions below