Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-08

Conditional define for a whole project

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fr0sT

I wonder how to set a conditional define for a project. All I want is to have 'FOO' defined so that I could use {$ifdef FOO}. I've read http://wiki.lazarus.freepascal.org/Macros_and_Conditionals but seems this is not what I need. Anyway I tried setting "foo=bar" in the build modes and creating build macro with "foo:=bar" - both in vain. ShowMessage({$I %foo%}) won't work and {$if foo=bar} too.

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Conditional-define-for-a-whole-project-tp3225300p3225300.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email

Graeme Geldenhuys
to Fr0sT
Fr0sT wrote
I wonder how to set a conditional define for a project. All I want is to have 'FOO' defined so that I could use {$ifdef FOO}.

There are a few methods to do this:

1. Use a common include file in ALL your units. Changing the include file applies
immediately to all units.

2. Add the '-dXXXXX' define in "Project > Options > Compiler Options > Other"

3. Add it to your fpc.cfg file.

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Fr0sT
to Graeme Geldenhuys: There are a few methods to do this: 1. Use a common include file in ALL your units.…
Graeme Geldenhuys wrote
2. Add the '-dXXXXX' define in "Project > Options > Compiler Options > Other"

Ahh, it's something like I need although I thought there would be separate "project defines" list. Thanks anyway!

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Conditional-define-for-a-whole-project-tp3225300p3225393.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email