Recent

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

Bazzao

  • Full Member
  • ***
  • Posts: 178
  • 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.

Thanks,

Bazza


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

Lazarus 2.0.10; FPC 3.2.0; SVN Revision 63526; x86_64-win64-win32/win64
Windows 10.

molly

  • Hero Member
  • *****
  • Posts: 2330
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 »

 

TinyPortal © 2005-2018