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.
Mailing lists / lazarus / 2011-08
Conditional define for a whole project
4 messages · 2 people ·
- FFr0sT 3
- GGraeme Geldenhuys 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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 .
Fr0sT wroteI 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
I wonder how to set a conditional define for a project. All I want is to have 'FOO'…
In other words, I mean setting FPC's "-d" option via GUI
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Conditional-define-for-a-whole-project-tp3225300p3225337.html
Sent from the Free Pascal - Lazarus mailing list .
There are a few methods to do this: 1. Use a common include file in ALL your units.…
Graeme Geldenhuys wrote2. 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 .
