> How can I embed git version info AUTOMATICALLY while I compile my
program
> > in lazarus, just like {$I %DATE%} ?
>
> Use a pre-compile script (Project Options|Compiler
> Options|Compilation|Execute Before) in combination with a include file.
>
Thanks.
I realized that this may not work for me. Because I need to compile the
project under both Linux and Windows, and then I need 2 scripts in the same
place :-(
Anyway, I tested with the simplest pre-build script:
git describe --always > REVISION.INC
Then in my program I added:
msgs.Lines.Add('GIT HASH: ' + {$I REVISION.INC});
Unfortunately, it does not compile, the error I got is:
unit1.pas(831,50) Error: Identifier not found "c25d546"
It seems that this directive does not load the include file as simple
string??
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus