Below is a sample "Run" in Lazarus IDE....
[TMainIDE.DoRunProject] A
TMainIDE.DoInitProjectRun A True 0
TMainIDE.DoInitProjectRun B
TMainIDE.DoSaveAll
TMainIDE.DoSaveProject End
[TCompiler.Compile] CmdLine="C:\FPC\2.0.0\bin\i386-win32\ppc386.exe
-S2cgi -OG1 -gl -WG -vewnhi -l -Fu..\..\lazarus\lcl\units\i386-win32\
-Fu..\..\lazarus\lcl\units\i386-win32\win32\
-Fu..\..\lazarus\packager\units\i386-win32\ -Fu.
-oD:\Projects\pascal\fpclaz\Test\project1.exe -dLCL -dLCLwin32
D:\Projects\pascal\fpclaz\Test\project1.lpr"
Hint: Start of reading config file C:\FPC\2.0.0\bin\i386-win32\fpc.cfg
Hint: End of reading config file C:\FPC\2.0.0\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 2.0.0 [2005/05/08] for i386
Copyright (c) 1993-2005 by Florian Klaempfl
Target OS: Win32 for i386
Compiling D:\Projects\pascal\fpclaz\Test\project1.lpr
Linking D:\Projects\pascal\fpclaz\Test\project1.exe
15 Lines compiled, 87.8 sec
[TCompiler.Compile] end
[TMainIDE.DoRunProject] B
NOTE: No debugger defined. Starting program without debugging ...
EXECUTING ""D:\Projects\pascal\fpclaz\Test\project1.exe""
WorkingDir "D:\Projects\pascal\fpclaz\Test\"
[TMainIDE.DoRunProject] END
As one might have noticed, the process that Lazarus creates just calls
fpc. So basically, my guess is that fpc is not capable of detecting as
of now that the project need not be compiled and linked........ just a
guess.
Based on this, I would think that fpc needs to have a compile switch as
was suggested before if a full recompile is needed or do nothing. Again,
as I suggested before this switch might only check the current project
and top level units used by the project to avoid checking thousands of
units. Or if this is difficult or future feature of the compiler then we
can implement a basic logic in Lazarus to check if the project needs a
recompile. If you all guys agree with this second option, I might be
able to work it out.
-Yoyong
I think, fpc does this automatically it compiles only units that are
changed ...
But I think if no changes are made lazarus musnt compile and link the
project ...
Christian
-----Ursprüngliche Nachricht-----
Von: Yoyong Hernan [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 7. Dezember 2005 03:51
An: [email protected]
Betreff: Re: [lazarus] Running a project always performs compile and
link sequence
Mattias Gaertner wrote:
On Tue, 06 Dec 2005 11:08:23 +0100
Florian Klaempfl <[EMAIL PROTECTED]> wrote:
Vincent Snijders wrote:
Yoyong Hernan wrote:
Hi All,
I guess this question was already asked before but I just couldn't
find the mail thread. Anyway, my question is about running a project
inside the IDE. I noticed that every time I pressed "F9" it always
goes to compile and link process even though there are no changes in
code.
Can anyone explain on this? If this is a bug, please let me know. I
am
trying to get on track again in Lazarus.
Checking changes is hard. Compiling it is the only to make sure that
you
running the latest saved source.
It's true, only the compiler can decide, if recompilation is needed.
But at least the IDE could reduce the compiler execution. We could
implement
the same mechanism as for packages:
- extending the project inspector to maintain all required files. Not
only
units.
- creating the 'projectname.compiled' file after build
Then the IDE could simply test, if any source file is newer than the
.compiled file.
I wanna help with the development of this project but based on the
ongoing discussion this seems like a big/difficult task to implement.
Anyway, if someone can guide me I might be able to help and improve my
skill level.
Back to the discussion. How would we know the files needed by the
project. I was thinking that we can parse for all the units used in a
project but how about the units used by project and the units used by
the units? Or can we just check the project and units it contains if the
files are older than the exe file then just run don't compile. I believe
this one should be easy. Now if the user made changes to units deep down
then he could just do a build.
So in summary, if user presses F9 check the project file and the top
level units. If the exe file is more recent then just run the file don't
do a compile. :-)
Is my solution too dumb? just my two cents :).
-Yoyong
The correct solution would be that the compiler doesn't recompile/link
if
there is an exe which is newer than any source. This isn't easy to
achieve
though, the compiler stored nowhere the information which include
files/units are used by the main program file.
And the command line options are not stored in the exe.
For example: some options depend on macros. So, even if the whole
project is
unchanged, and the exe is newer, a rebuild could be neccessary. That's
why
the .compiled file is needed.
Then there are only two cases left, when the IDE test will fail:
- Some statically linked in libs changed.
- Something changed the filedates.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives