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

Reply via email to