News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

build options for targets being developed in both windows and linux

Started by vri, January 27, 2009, 03:14:26 PM

Previous topic - Next topic

vri

We are working on a project for an app that should run in both windows and linux. Development is being done on both platforms, using gcc and mingw. Codeblocks is great for this!

I have a small problem, however. We make use of boost and some other libs. Under windows, I need to set a -I option for the include path for that, I do this using a global variable $(#boost). Under linux, this is not needed. The unfortunate thing is that if I open the project under linux, CB insists on setting a global variable $(#boost), which I'd rather not do. Actually, I have a whole list of them in my workspace, and I seem to be unable to continue in a decent way unless I do specify them.

So my question is two-fold:
- can I specify compiler options (-I) and/or linker options in a project for a specific platform only (without making the target compiler-specific, which is undesired in my case)?
- can I somehow ignore or invalidate global variables when opening a project or workspace?

Thanks, Theo.

P.S. CB 8.02, gcc & mingw, XP and ArchLinux

Jenna

You can try to use something like this as search-directory:
[[if (PLATFORM == PLATFORM_MSW) print(_T("$(#boost)"));]]

vri


vri

Sorry to bother you again...

Yesterday it worked...
This morning, I upgraded my linux box to gcc 4.3.3
And now, it apparently doesn't work anymore. It seems that the empty compiler directive "-I" that results on linux leads to problems during the linking step afterwards. I get errors like "multiple definitions of `_start' ".

Any ideas?

Theo.

Jenna

[[if (PLATFORM == PLATFORM_MSW) print(_T("$(#boost)")) else print (_T("."));]]

vri

Sigh... how obvious...

and I pretend to be a programmer...

Thanks again!

Theo.

vri

Further answering my own question: I remembered having read about this before, just didn't manage to find the thread.
But now I did:
http://forums.next.codeblocks.org/index.php/topic,8643.msg63221.html#msg63221

helpful as well.