Recent

Author Topic: Debug and Release build modes [SOLVED]  (Read 2572 times)

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Debug and Release build modes [SOLVED]
« on: March 04, 2023, 09:07:57 pm »
Hello, for the time being I use the set my build modes by navigating through Project - Project Options - Compiler Options and choose Build and Release modes there. The problem is that I have to do the same steps every time I create a new project. I don't want that, I want my configurations to persist and have my Debug and Release always fixed.
Is there any way to achieve this?
« Last Edit: March 04, 2023, 09:56:15 pm by YiannisKam »
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

TRon

  • Hero Member
  • *****
  • Posts: 3129
Re: Debug and Release build modes
« Reply #1 on: March 04, 2023, 09:17:14 pm »
check set compiler options as default in the project options dialog ?

for a location see left bottom (above help button) at picture, see: https://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options#Changing_the_LCLWidgetType_in_Version_1.1_and_above
« Last Edit: March 04, 2023, 09:19:47 pm by TRon »
All software is open source (as long as you can read assembler)

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes
« Reply #2 on: March 04, 2023, 09:23:04 pm »
I've tried that already but unfortunately it doesn't work.
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

TRon

  • Hero Member
  • *****
  • Posts: 3129
Re: Debug and Release build modes
« Reply #3 on: March 04, 2023, 09:34:48 pm »
I just checked with Lazarus 2.2.4 and it seems to work for me. e.g. when i check the option as mentioned, then add build modes , then press the ok button, then Lazarus stores the newly created buiold modes and keeps the settings in a global manner when I open up a new project and select a specific build mode (build mode that I just created). Whether or not I close and start Lazarus again does not seem to matter.

Which version of Lazarus are you using ?

edit: You  can check for yourself by viewing the file named projectoptions.xml in your Lazarus configuration directory, which should contain the new created build modes.
« Last Edit: March 04, 2023, 09:39:09 pm by TRon »
All software is open source (as long as you can read assembler)

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes
« Reply #4 on: March 04, 2023, 09:39:27 pm »
My lazarus ide version is 2.3.0
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

TRon

  • Hero Member
  • *****
  • Posts: 3129
Re: Debug and Release build modes
« Reply #5 on: March 04, 2023, 09:43:13 pm »
Also works for me with Lazarus 2.3.0.

Could you share your Lazarus revision (date might work as well) and platform please ?
All software is open source (as long as you can read assembler)

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes
« Reply #6 on: March 04, 2023, 09:54:55 pm »
Sorry TRon, my bad as I had to check the rightmost boxes, then check the set compiler options as default and finally save everything. Now it works %). Anyway thanks for your time, I really appreciate it.
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

TRon

  • Hero Member
  • *****
  • Posts: 3129
Re: Debug and Release build modes [SOLVED]
« Reply #7 on: March 04, 2023, 10:13:03 pm »
No problem YiannisKam.

Just a misunderstanding on how Lazarus expects in what order things needs to be done exactly.

Thank you for reporting back.
All software is open source (as long as you can read assembler)

stefankr

  • Newbie
  • Posts: 1
Re: Debug and Release build modes [SOLVED]
« Reply #8 on: March 12, 2023, 03:23:22 pm »
Hello, and apologies for bringing this up again, but I am still having the same issue on 2.2.4 on Windows 10. Even tough I followed the advice in this thread. I click on "create debug and release modes", then check the two boxes for debug and release "in the session", but not checking them doesn't change anything either. Then I confirm with OK, check "set compiler options as default", then click on OK. Now when I start a new project, I only have the defaut mode. What else can I do to make this work? Thank you in advance for your help.

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes [SOLVED]
« Reply #9 on: March 13, 2023, 02:16:38 am »
I don't have an answer because it worked for me for a while but now I see only the debug option in my settings. The release setting disappeared completely and I have to set it manually again and again, no matter how many times I have to save the new settings. And I've tried every possible setting combination. It doesn't make any sense so I quit.
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes [SOLVED]
« Reply #10 on: March 14, 2023, 03:29:42 am »
Ok, final comment here as I managed to solve the problem by editing manually the projectoptions.xml file.
Code: XML  [Select][+][-]
  1.     <BuildModes>
  2.       <Item Name="Debug" Default="True"/>
  3.       <Item Name="Release" Default="False"/>            
  4.     </BuildModes>
For some reason which I have no idea why the <Item Name="Release" Default="False"/> was missing.
I hope this helps if someone has the same issue. Just navigate into your lazarus installation folder and inside the config_lazarus folder resides the projectoptions.xml file
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

PeterX

  • Sr. Member
  • ****
  • Posts: 411
Re: Debug and Release build modes [SOLVED]
« Reply #11 on: August 15, 2024, 05:22:35 pm »
.. I have to do the same steps every time I create a new project. I don't want that, I want my configurations to persist and have my Debug and Release always fixed.
Is there any way to achieve this?
Sorry for stepping in here this late .. I use a separate INCLUDE file with .. for example:

Code: Pascal  [Select][+][-]
  1. {$IFDEF DEBUG_VERSION}
  2.   // Compiler Switches:
  3.   {$ASSERTIONS ON}
  4.   {$DEBUGINFO ON}         // Include debugging symbols //
  5.   {$HINTS ON}             // keep hints ON .. //
  6.   {$IOCHECKS ON}          // Include Input/Output checking.
  7.   {$OVERFLOWCHECKS ON}    // enabling overflow checking slows down your program .. !
  8.   {$RANGECHECKS ON}       // enabling range checking slows down your program .. !
  9.   {$Warnings ON}          // allow warnings .. //
  10.  
  11. {$ELSE}
  12.   // Compiler Switches:
  13.   {$ASSERTIONS OFF}       // same as $C-
  14.   {$DEBUGINFO OFF}        // no debugging symbols
  15.   {$HINTS OFF}            // no short switch defined in Delphi
  16.   {$IOCHECKS OFF}         // same as $I-
  17.   {$OVERFLOWCHECKS OFF}
  18.   {$RANGECHECKS OFF}
  19. {$ENDIF}
  20.  

Indeed this is a little bit "OldStyle", but works for me  :)
« Last Edit: August 15, 2024, 05:24:30 pm by PeterX »
usually using latest Lazarus release version with Windows 10

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: Debug and Release build modes [SOLVED]
« Reply #12 on: August 15, 2024, 07:29:43 pm »
Interesting, thank you
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

 

TinyPortal © 2005-2018