Boost logo

Boost-Build :

From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2008-06-02 04:21:55


   Hi Rick.

> Actually, all the Jam variables used without being declared using the
> 'local' keyword are considered global ones and are located in the
> current module (a.k.a. namespace). Also Boost Build uses a coding
> convention naming all such global variables using a dot prefix.
>
> But I can't found .abbreviated-$(string) with [ VARNAMES string ] . :-)

   Well... no you can not, at least not until you call the rule using it
at least once.

   For an example paste the following code into a file named
test-module.jam and them import it from an otherwise empty Jamroot.jam

# ------------------------------------------------------------
.xxx = "Global variable in the test-module module." ;

rule puff ( )
{
     .yyy = "Global variable in the test-module module defined inside a
rule." ;
}

module
{
     .zzz = "Global variable in the global module." ;
}

ECHO Global: [ VARNAMES ] ;
ECHO test-module: [ VARNAMES test-module ] ;
puff ;
ECHO test-module: [ VARNAMES test-module ] ;
# ------------------------------------------------------------

   Hope this helps.

   Best regards,
     Jurko Gospodnetić


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk