diff options
Diffstat (limited to 'compilerswitchupdateunit.pas')
-rw-r--r-- | compilerswitchupdateunit.pas | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/compilerswitchupdateunit.pas b/compilerswitchupdateunit.pas new file mode 100644 index 0000000..ab11a9c --- /dev/null +++ b/compilerswitchupdateunit.pas @@ -0,0 +1,36 @@ +unit compilerswitchupdateunit; + +{$mode objfpc}{$H+} + +{$INCLUDE Compilerswitches.inc} +{$R compilerswitchupdateunit.rc} + +interface + +uses + Classes, SysUtils; + +implementation + +uses myStringListUnit,refreshExecutableUnit; + +var + ciRuntime,ciCompiletime: tMyStringList; + update: boolean; + +initialization + ciRuntime:=tMyStringList.create; + ciCompiletime:=tMyStringList.create; + + ciRuntime.loadFromFile(extractFilePath(paramstr(0))+'/Compilerswitches.inc'); + ciCompiletime.loadFromResource('COMPILERSWITCHES_INC'); + + update:=ciCompiletime.text<>ciRuntime.text; + + ciCompiletime.free; + ciRuntime.free; + + if update then + refreshExecutable(extractFilePath(paramstr(0))); +end. + |