Boost logo

Boost-Build :

From: Kostas Kostiadis (kos_at_[hidden])
Date: 2006-04-24 05:17:47


Hello all,

 

The quick version of my question:

 

Where is the best place to specify global defines that are then propagated
to all sub-projects?

For example, I need to have something like:

 

requirements <variant>debug:<define>ENABLE_ASSERTS

 

that will be true for ALL projects under a certain root directory.

 

 

 

The long version of my question (explained by example):

Say I have a UTILS lib (in its own folder with its own Jamfile) and one of
its source files has something along the lines of:

 

#ifdef ENABLE_ASSERTS

#define ASSERT OutputSomeMessageAndHalt

#else

#define ASSERT NothingFunction

#endif

 

In this lib (i.e. UTILS) the Jamfile has something like

 

project UTILS

                : requirements <variant>debug:<define>ENABLE_ASSERTS

                ;

 

Now say I have another lib, call it MATH, which uses the UTILS lib.

Because I can't specify the order things are build, ASSERT ends up being the
NothingFunction during debug builds of the MATH lib.

 

The only way I found of "fixing" this, is by adding this

                : requirements <variant>debug:<define>ENABLE_ASSERTS

 

to project MATH in the math lib Jamfile as well...

This is quite bad because it means I'll have to define ENABLE_ASSERTS in all
the other Jamfiles for all libs and projects that want to use it.

What is the best way to deal with this problem? Is defining ENABLE_ASSERTS
globally somewhere the best solution?

If so, how can I do this?

 

 

Cheers,

K.

 



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