Re: Re: Update: gexace error with conditional options and clusters

Eric Bezault <ericb-D6Qt/9opevxWk0Htik3J/[email protected]> Tue, 13 May 2008 15:06:13 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Brian Heilig wrote:
> And finally, here is the library.xace file referenced in the above
> system file:
> 
> <?xml version="1.0"?>
> 
> <library name="secom" prefix="com_">
>   <description>
>     description: "Xace file for the Serial Communications Library"
>     library: "Serial Communications Library"
>     copyright: "Copyright (c) 2005, Brian E. Heilig"
>     license: "Eiffel Forum License v2 (see license.txt)"
>     date: "$Date: 2006/03/26 05:07:52 $"
>     revision: "$Revision: 1.8 $"
>   </description>
> 
>   <cluster name="secom" location="${SECOM}/library">
>     <cluster name="ewg">
>       <cluster name="spec">
>         <option name="abstract" value="true"/>
>         <cluster name="${GOBO_EIFFEL}" prefix="ewg_spec_"/>
>       </cluster>
>     </cluster>
> 
>     <cluster name="windows" if="${GOBO_OS}=windows"/>
>     <cluster name="posix" if="${GOBO_OS}=unix"/>
>     <cluster name="abstract"/>
>   </cluster>
> 
>   <option name="link" value="${SECOM}/library/posix/c/overall_timer.o"
> if="${GOBO_OS}=unix"/>
>   <option name="header" value="${SECOM}/library/ewg/c"/>
>   <option name="header" value="${SECOM}/library/posix/c"
> if="${GOBO_OS}=unix"/>
> </library>

OK, I got it. Options declared at the level of the library are
only taken into account when the library.xace is used as root
Xace file (for example to precompile a library). They are not
propagated to other Xace files "mounting" it (because Xace
would not know how to deal with conflicts). If you want these
options to be propagated, you should attach them to clusters.
For example:

   <cluster name="secom" location="${SECOM}/library">
     <cluster name="ewg">
       <cluster name="spec">
         <option name="abstract" value="true"/>
         <cluster name="${GOBO_EIFFEL}" prefix="ewg_spec_"/>
       </cluster>
     </cluster>

     <cluster name="windows" if="${GOBO_OS}=windows"/>
     <cluster name="posix" if="${GOBO_OS}=unix"/>
     <cluster name="abstract"/>
     <option name="link" value="${SECOM}/library/posix/c/overall_timer.o"
if="${GOBO_OS}=unix"/>
     <option name="header" value="${SECOM}/library/ewg/c"/>
     <option name="header" value="${SECOM}/library/posix/c"
if="${GOBO_OS}=unix"/>
   </cluster>

-- 
Eric Bezault
mailto:ericb-D6Qt/9opevxWk0Htik3J/[email protected]
http://www.gobosoft.com