summaryrefslogtreecommitdiff
path: root/compilerswitchupdateunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-12-09 13:00:07 +0100
committerErich Eckner <git@eckner.net>2015-12-09 13:00:07 +0100
commit93ef98f448e970776158e7627250aeec15583ea9 (patch)
tree3a974e575c88dbc49b348ce0c848ef59e98c7f0a /compilerswitchupdateunit.pas
parentde3564b370141744197501fc6aa645eddf84fc23 (diff)
downloadunits-93ef98f448e970776158e7627250aeec15583ea9.tar.xz
compilerswitchupdateunit.{pas,rc} neu
Diffstat (limited to 'compilerswitchupdateunit.pas')
-rw-r--r--compilerswitchupdateunit.pas36
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.
+