Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-05

Additional compiler config file is ignored by IDE

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I wanted to use the additional compiler config file to enable multiple build modes (Release, Debug etc). The setting is found at: "Project > Options > Compiler Options > Other"

I have tried the following values with and without the $(ProjPath) macro, and the Lazarus IDE doesn't seem to used the *.cfg files at all. The generated executable is always the same size no matter what compiler options I add to either of the .cfg files. :-/

$(ProjPath)/debug_build.cfg
$(ProjPath)/release_build.cfg

Is this just another "would be nice to have feature" that isn't actually implemented or is it simply broken? I'm using latest Lazarus trunk revision.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Graeme Geldenhuys
Graeme Geldenhuys wrote 18 lines
Hi, I wanted to use the additional compiler config file to enable multiple build modes (Release, Debug etc). The setting is found at: "Project > Options > Compiler Options > Other" I have tried the following values with and without the $(ProjPath) macro, and the Lazarus IDE doesn't seem to used the *.cfg files at all. The generated executable is always the same size no matter what compiler options I add to either of the .cfg files. :-/ $(ProjPath)/debug_build.cfg $(ProjPath)/release_build.cfg Is this just another "would be nice to have feature" that isn't actually implemented or is it simply broken? I'm using latest Lazarus trunk revision.

What does "Show options" give?

Vincent

Reply by email

Graeme Geldenhuys
to Vincent Snijders
Vincent Snijders wrote
What does "Show options" give?

Exactly what I entered into the edit field. When a macro is used, it doesn't expand the macro either. When I entered the full path (/home/graemeg/..../debug_build.cfg) it makes no difference either. The compiler options defined in the *.cfg files are simply ignored when compiled via Lazarus IDE.

And to make sure I haven't lost all my marbles, I copy and pasted the information inside the *.cfg file into the "Other options" memo and disable the Additional Options edit field, and then my executable does vary in size etc based on compiler options. So it's not like my compiler options are invalid options.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Graeme Geldenhuys
Graeme Geldenhuys wrote 16 lines
On 25 May 2010 10:01, Vincent Snijders wrote: > What does "Show options" give? Exactly what I entered into the edit field. When a macro is used, it doesn't expand the macro either. When I entered the full path (/home/graemeg/..../debug_build.cfg) it makes no difference either. The compiler options defined in the *.cfg files are simply ignored when compiled via Lazarus IDE. And to make sure I haven't lost all my marbles, I copy and pasted the information inside the *.cfg file into the "Other options" memo and disable the Additional Options edit field, and then my executable does vary in size etc based on compiler options. So it's not like my compiler options are invalid options.

And if you copy the options in Show options to a command line after the compiler path, what happens then?

Vincent

Reply by email

Graeme Geldenhuys
to Vincent Snijders
Vincent Snijders wrote
And if you copy the options in Show options to a command line after the compiler path, what happens then?

OK, I finally figured out the problem. My *.cfg files had one line in them listing all the compiler parameters one after the other.

Lazarus or FPC never listed any problems with that, as the compiler output below shows. It also (silently) never used any of the options in the *.cfg file. But as soon as I change my *.cfg files to list one parameter per line, then it compiles correctly.

So the problem actually sits with FPC. To highlight this problem, I simply need to modify my *.cfg files to have multiple lines, but make of the the lines contain more than one compiler parameter. Instantly FPC fails to compile the project, but having them all on one line it doesn't.

------------------[ full message window output with hidden lines ]--------------------
'3.0.5.31.gb7cb8.dirty';
"Executing command before" completed
Hint: Start of reading config file /home/graemeg/.fpc.cfg Hint: End of reading config file /home/graemeg/.fpc.cfg Hint: Start of reading config file release64_build.cfg Hint: End of reading config file release64_build.cfg Free Pascal Compiler version 2.4.1 [2010/04/30] for x86_64 Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for x86-64
Compiling tutoradmin.lpr
Compiling /home/graemeg/programming/MasterMaths/m2_system/Source/constants.pas ... <SNIP> ....
Linking ../../Bin/x86_64-linux/tutoradmin
/usr/bin/ld: warning: ../../Bin/x86_64-linux/link.res contains output sections; did you forget -T?
528 lines compiled, 0.8 sec
97 hint(s) issued
"Executing command after" completed
Project "tutoradmin" successfully built
--------------------------

Thanks for helping me narrow down the issue. I'll report this bug in Mantis, FPC project.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 18 lines
On 25 May 2010 10:13, Vincent Snijders wrote: > > And if you copy the options in Show options to a command line after the > compiler path, what happens then? OK, I finally figured out the problem. My *.cfg files had one line in them listing all the compiler parameters one after the other. Lazarus or FPC never listed any problems with that, as the compiler output below shows. It also (silently) never used any of the options in the *.cfg file. But as soon as I change my *.cfg files to list one parameter per line, then it compiles correctly. So the problem actually sits with FPC. To highlight this problem, I simply need to modify my *.cfg files to have multiple lines, but make of the the lines contain more than one compiler parameter. Instantly FPC fails to compile the project, but having them all on one line it doesn't.

AFAIK this was always the case. I also stumbled in this trap some years ago. It would be nice if the standard fpc.cfg would mention this in the start comments.

Lazarus does not parse the configs directly. It lets fpc parse it and watches the -va output.

[...] Thanks for helping me narrow down the issue. I'll report this bug in Mantis, FPC project.

Mattias

Reply by email