<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>I've implemented the basic workings of package dependency in fpmkunit. Please find attached a patch against tagged FPC2.6.2.</p>
<p>Could someone (like Michael f.i.) please review the patch and let me know (either on the list or by pm) what you think? The patch does not include code that recusively searches the packages, although I'm not sure this is what you would like as circular dependencies will get more difficult to find. Either way the patch will be expanded to include this kind of a check once the basic working version is approved. You can test with the test app that I attached earlier.</p>
<p> </p>
<p>BTW: Lots of OSS nowadays use online review tools in combination with their bugtrackers. Would such a tool help the core developers in their work to review and resolve patches? One interesting tool is <a href="http://phabricator.org/">http://phabricator.org/</a></p>
<p>Regards, Darius</p>
<p> </p>
<div> </div>
<p>Darius Blaszyk schreef op 6 apr '14:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<p>Hi all,<br />I'm trying to use fpmake for my own project which is built up of a couple of packages. The final application has a dependency on these packages.</p>
<p>Which I have done like this:</p>
<p> </p>
<p>P := AddPackage('my_app');</p>
<p>P.Directory := 'app';</p>
<p>T := P.Targets.AddProgram('hello.pp');</p>
<p>T.Dependencies.Add('my_pkg');</p>
<p> </p>
<p>However, adding the dendencies does not add the units output dir to the target. I think it would be a good idea to do this by default. Do you agree?</p>
<p>Please find the output of my test case (which is also attached) below.</p>
<p>Regards, Darius</p>
<p> </p>
<div>
<p>C:\develop\repository\test>fpmake -v</p>
<p>Start compiling package my_pkg for target x86_64-win64.</p>
<p>Creating output dir "pkg\units\x86_64-win64"</p>
<p> Compiling target testunit</p>
<p> Executing command "fpc -Twin64 -Px86_64 -FUpkg\units\x86_64-win64 -FuC:\lazarus\fpc\2.6.2\units\x86_64-win64\rtl pkg\testunit.pas"</p>
<p>Free Pascal Compiler version 2.6.2 [2014/02/28] for x86_64</p>
<p>Copyright (c) 1993-2012 by Florian Klaempfl and others</p>
<p>Target OS: Win64 for x64</p>
<p>Compiling pkg\testunit.pas</p>
<p>14 lines compiled, 0.0 sec</p>
<p>Generating "pkg\units\x86_64-win64\fpunits.cfg"</p>
<p>[ 67%] Compiled package my_pkg</p>
<p>Warning: Circular dependency detected when compiling package my_app with package my_app</p>
<p>Start compiling package my_app for target x86_64-win64.</p>
<p>Creating output dir "app\units\x86_64-win64"</p>
<p>Creating output dir "app\bin\x86_64-win64"</p>
<p>Warning: Target hello of package my_app depends on another package (my_pkg). These kind of dependencies are not processed</p>
<p> Compiling target hello</p>
<p> Executing command "fpc -Twin64 -Px86_64 -FEapp\bin\x86_64-win64 -FUapp\units\x86_64-win64 -FuC:\lazarus\fpc\2.6.2\units\x86_64-win64\rtl -Fuapp\ app\hello.pp"</p>
<p>Free Pascal Compiler version 2.6.2 [2014/02/28] for x86_64</p>
<p>Copyright (c) 1993-2012 by Florian Klaempfl and others</p>
<p>Target OS: Win64 for x64</p>
<p>Compiling app\hello.pp</p>
<p>hello.pp(6,3) Fatal: Can't find unit testunit used by hello</p>
<p>Fatal: Compilation aborted</p>
<p>Error: C:\lazarus\fpc\2.6.2\bin\x86_64-win64\ppcx64.exe returned an error exitcode (normal if you did not specify a source file to be compiled)</p>
<p>The installer encountered the following error:</p>
<p>External command "fpc -Twin64 -Px86_64 -FEapp\bin\x86_64-win64 -FUapp\units\x86_64-win64 -FuC:\lazarus\fpc\2.6.2\units\x86_64-win64\rtl -Fuapp\ app\hello.pp" failed with exit code 1. Console output:</p>
<p>Free Pascal Compiler version 2.6.2 [2014/02/28] for x86_64</p>
<p>Copyright (c) 1993-2012 by Florian Klaempfl and others</p>
<p>Target OS: Win64 for x64</p>
<p>Compiling app\hello.pp</p>
<p>hello.pp(6,3) Fatal: Can't find unit testunit used by hello</p>
<p>Fatal: Compilation aborted</p>
<p>Error: C:\lazarus\fpc\2.6.2\bin\x86_64-win64\ppcx64.exe returned an error exitcode (normal if you did not specify a source file to be compiled)</p>
<p> </p>
</div>
<!-- html ignored --><br />
<pre>_______________________________________________
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
</body></html>