<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body smarttemplateinserted="true">
<div id="smartTemplate4-template">Hi,<br>
<blockquote type="cite">However, you can possibly solve it by
always taking the options from an environment variable to the
command line and then including contents of this command line to
your sources. </blockquote>
</div>
<div><br>
</div>
<div>Unfortunately it is picking up all kinds of options from
fpc.cfg and Lazarus.</div>
<div><br>
</div>
<div>Like in this case, I tried to disable range checking, and it is
still enabled. <br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>> You can introduce something like that yourself by always
building all your sources from scratch, but then the solution
outlined above should work for you. <br>
</div>
<div><br>
<p>I am setting up a build server that compiles the entire project
from scratch on every commit. <br>
</p>
<br>
Best,<br>
Benito </div>
<div class="moz-cite-prefix">On 28.05.22 14:34, Tomas Hajny via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:280d39a5e59fd28a65cd91f2f3e5efad@hajny.biz">On
2022-05-28 13:44, Benito van der Zander via fpc-pascal wrote: <br>
<br>
<br>
Hi, <br>
<br>
<blockquote type="cite">I want to show how my program was
compiled. <br>
<br>
Now I have string like "FPC3.2.2 i386-Linux R+C+" from <br>
<br>
compiler := 'FPC' + {$INCLUDE %FPCVERSION%} + ' ' + {$INCLUDE
<br>
%FPCTargetCPU%}+'-'+{$INCLUDE %FPCTargetOS%}+ ' ' + {$IfOpt <br>
R+}+'R+'{$endif} {$IfOpt S+}+'S+'{$endif} {$IfOpt
O+}+'O+'{$endif} <br>
{$IfOpt Q+}+'Q+'{$endif} {$IfOpt M+}+'M+'{$endif} {$IfOpt <br>
C+}+'C+'{$endif}; <br>
<br>
But the optimization level (-O2 or -O1 ...) is missing. <br>
<br>
Is there an IFOPT for that? Or a define with all the arguments <br>
</blockquote>
<br>
I don't think that there's such an option at the moment. However,
you can possibly solve it by always taking the options from an
environment variable to the command line and then including
contents of this command line to your sources. I don't think that
it makes much sense for the compiler to provide such an option,
because unlike the compiler version, different options (including
the optimization level) may be used for compilation of different
units and there's no such a thing as a general optimization level
valid for the complete compiled program from the compiler point of
view. You can introduce something like that yourself by always
building all your sources from scratch, but then the solution
outlined above should work for you. <br>
<br>
Tomas <br>
_______________________________________________ <br>
fpc-pascal maillist - <a class="moz-txt-link-abbreviated
moz-txt-link-freetext"
href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext"
href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
<br>
</blockquote>
</body>
</html>