Boost logo

Boost-Build :

From: Jurko Gospodnetić (jurko.gospodnetic_at_[hidden])
Date: 2008-07-30 07:44:29


   Hi Markus,

>> actions compile.c++
>> {
>> $(CONFIG_COMMAND) -x cxx -c -std strict_ansi -nopure_cname
>> -noimplicit_include -timplicit_local -ptr "$(<[1]:D)/cxx_repository"
>> $(OPTIONS) "-pending_instantiations "$(TEMPLATE_DEPTH) -D$(DEFINES)
>> -I"$(INCLUDES)" -o "$(<)" "$(>)"
>> }
>
> Won't that expand to '-pending_instantiations' (instead of nothing) when
> TEMPLATE_DEPTH is empty?

   Nope, that is what the quotes are for - to make the
"-pending_instantiations " text be joined to the TEMPLATE_DEPTH variable
expansion.

   In Boost Jam (as well as the original Jam) when you do xxx$(var) you
get all the values of 'var', with each one of them prefixed by 'xxx'.

   Had we written:

   -pending_instantiations $(TEMPLATE_DEPTH)

   (note the missing quotes) Boost Jam would have interpreted this as
"string literal '-pending_instantiations' and then all the values of
TEMPLATE_DEPTH".

   With the quotes:

   "-pending_instantiations "$(TEMPLATE_DEPTH)

   (note the added quotes) Boost Jam interprets this as "all the values
of TEMPLATE_DEPTH, each one prefixed with '-pending_instantiations'"
which comes out as nothing in case TEMPLATE_DEPTH is an empty list.

   You can see the same technique applied for expanding DEFINES &
INCLUDES variables in the original action code.

   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