User forums > Using Code::Blocks

build options for targets being developed in both windows and linux

(1/2) > >>

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:

--- Code: ---[[if (PLATFORM == PLATFORM_MSW) print(_T("$(#boost)"));]]
--- End code ---

vri:
Works perfectly so far, thank you!

Theo.

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:

--- Code: ---[[if (PLATFORM == PLATFORM_MSW) print(_T("$(#boost)")) else print (_T("."));]]
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version