* * *

Author Topic: [SOLVED] Automating a compilation.  (Read 639 times)


  • Full Member
  • ***
  • Posts: 109
  • Pies are squared.
[SOLVED] Automating a compilation.
« on: August 28, 2017, 11:48:03 pm »
In my project, in Lazarus IDE, I have a directive

{$DEFINE Test01}

that defines development / testing values (eg filenames etc).

When I want to compile a production version, I have to turn off test01, compile, turn Test01 back on.

Then I run a batch file to copy the exe to the production area.

How to I automate the compilation, turning off Test01 for that compilation.



« Last Edit: September 09, 2017, 06:54:35 am by Bazzao »

Lazarus 1.6.4 r54278 FPC 3.0.2 x86_64-win64-win32/win64
Windows 10, 7.


  • Hero Member
  • *****
  • Posts: 2345
Re: Automating a compilation.
« Reply #1 on: August 29, 2017, 04:12:22 am »
Instead of defining the define manually inside your code, use different build-modes (and switch between them).

In a build-mode you can define the define when for example building your application in debug-mode.

Also note that it is also possible to let Lazarus do the copy automatically for you (see projects options compiler commands, wiki here), afaik that is on a per build-mode base.
« Last Edit: August 29, 2017, 04:32:26 am by molly »



Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus