<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Il 18/06/2015 23:48, aradeonas ha
scritto:<br>
</div>
<blockquote
cite="mid:1434664137.2427066.299427137.50F8FF70@webmail.messagingengine.com"
type="cite">
<title></title>
<div>Hi,<br>
</div>
<div> </div>
<div>I made package including some units that some of them need
LCL but some of them will be need in server tools and they
should not use LCL or graphical stuff so I want to make 2
package one for client app and other one for server with some of
tools and without any dependency on graphical stuff so for
server apps I will add server package.<br>
</div>
<div>But I have units share with these two package that used
TPicture in some parts but they can be removed with compiler
condition.<br>
</div>
<div> </div>
<div>I want to know what is the best way to declare these two
package and compiler condition so I will have two package with
shared units but for different usage case.</div>
</blockquote>
<br>
I'd suggest to avoid sharing units between packages. But different
units may include a .inc file which contains the shared code.<br>
<br>
Sort of:<br>
<br>
server.pas:<br>
<blockquote>Unit server;<br>
{$DEFINE IS_SERVER}<br>
{$INCLUDE common.inc}<br>
.end<br>
</blockquote>
client.pas:<br>
<blockquote>Unit client;<br>
{$INCLUDE common.inc}<br>
.end<br>
</blockquote>
<br>
common.inc:<br>
<br>
<blockquote>Interface<br>
{$IFDEF IS_SERVER}<br>
..... server uses, etc.<br>
{$ELSE}<br>
..... client uses,etc<br>
{$ENDIF}<br>
....common uses,etc.<br>
<br>
Implementation<br>
{$IFDEF IS_SERVER}<br>
..... server stuff<br>
{$ELSE}<br>
..... client stuff<br>
{$ENDIF}<br>
....common stuff<br>
<br>
</blockquote>
One package uses the "server" unit, the other the "client" unit, but
all of your source is in common.inc for easier maintnance.<br>
<br>
That way the compiler will never be confused about which units to
compile, and with which conditionals.<br>
<br>
Maybe there's a better way, but that's what I'd do.<br>
<br>
Giuliano<br>
<br>
<pre class="moz-signature" cols="72">--
Giuliano Colla
Project planning question: when it's 90% done, are we halfway or not yet?
</pre>
</body>
</html>