Recent

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

YiannisKam

  • Jr. Member
  • **
  • Posts: 99
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 »

TRon

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

YiannisKam

  • Jr. Member
  • **
  • Posts: 99
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.

TRon

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

YiannisKam

  • Jr. Member
  • **
  • Posts: 99
Re: Debug and Release build modes
« Reply #4 on: March 04, 2023, 09:39:27 pm »
My lazarus ide version is 2.3.0

TRon

  • Hero Member
  • *****
  • Posts: 2435
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 ?

YiannisKam

  • Jr. Member
  • **
  • Posts: 99
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.

TRon

  • Hero Member
  • *****
  • Posts: 2435
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.

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

  • Jr. Member
  • **
  • Posts: 99
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.

YiannisKam

  • Jr. Member
  • **
  • Posts: 99
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

 

TinyPortal © 2005-2018