List Info

Thread: propagating requirements to libraries




propagating requirements to libraries
country flaguser name
United States
2007-04-03 14:13:26
Sorry for the newbie-ish question, but I couldn't find the
answer in the 
docs or by playing with BBv2, so ....

I have a situation like this:

project
     : requirements
      
<library>/boost/test//boost_unit_test_framework
       <link>static
       # MSVC-8's iterator debugging causes some tests to
run forever.
      
<toolset>msvc-8.0:<define>_HAS_ITERATOR_DEBUGGIN
G=0
     ;

test-suite "accumulators"
     : [ run count.cpp ]
       [ run covariance.cpp ]
...
     ;

This causes all of my tests to crash, because the tests are
built with 
_HAS_ITERATOR_DEBUGGING=0, and the unit test framework is
not. What I 
really need to do is build my *own* version of the unit test
framework 
with this define, and link to that. But I don't know how to
get the 
<define> requirement to propagate to the library.

Can anybody tell me the magic incantation?

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: propagating requirements to libraries
country flaguser name
Ukraine
2007-04-04 01:23:00
Hello, Eric!
You wrote  on Tue, 03 Apr 2007 12:13:26 -0700:

 EN> Sorry for the newbie-ish question, but I couldn't
find the answer in
 EN> the docs or by playing with BBv2, so ....

 EN> I have a situation like this:

 EN> project
 EN>      : requirements
 EN>       
<library>/boost/test//boost_unit_test_framework
 EN>        <link>static
 EN>        # MSVC-8's iterator debugging causes some
tests to run forever.
 EN>       
<toolset>msvc-8.0:<define>_HAS_ITERATOR_DEBUGGIN
G=0
 EN>      ;

 EN> test-suite "accumulators"
 EN>      : [ run count.cpp ]
 EN>        [ run covariance.cpp ]
 EN> ...
 EN>      ;

 EN> This causes all of my tests to crash, because the
tests are built with
 EN> _HAS_ITERATOR_DEBUGGING=0, and the unit test
framework is not. What I
 EN> really need to do is build my *own* version of the
unit test framework
 EN> with this define, and link to that. But I don't know
how to get the
 EN> <define> requirement to propagate to the
library.

 EN> Can anybody tell me the magic incantation?

Try this

import feature ;

feature.feature iterator_debugging : on off : composite
propagated optional 
;
feature.compose <iterator_debugging>off :
<define>_HAS_ITERATOR_DEBUGGING=0 
;

project
     : requirements
      
<library>/boost/test//boost_unit_test_framework
       <link>static
       # MSVC-8's iterator debugging causes some tests to
run forever.
      
<toolset>msvc-8.0:<iterator_debugging>off
     ;

test-suite "accumulators"
     : [ run count.cpp ]
       [ run covariance.cpp ]
...
     ;

With best regards, Konstantin Litvinenko. 


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: propagating requirements to libraries
country flaguser name
United States
2007-04-04 10:55:46
Konstantin Litvinenko wrote:
> Hello, Eric!
> You wrote  on Tue, 03 Apr 2007 12:13:26 -0700:
> 
>  EN> This causes all of my tests to crash, because
the tests are built with
>  EN> _HAS_ITERATOR_DEBUGGING=0, and the unit test
framework is not. What I
>  EN> really need to do is build my *own* version of
the unit test framework
>  EN> with this define, and link to that. But I don't
know how to get the
>  EN> <define> requirement to propagate to the
library.
> 
>  EN> Can anybody tell me the magic incantation?
> 
> Try this
> 
> import feature ;
> 
> feature.feature iterator_debugging : on off : composite
propagated optional 
> ;
> feature.compose <iterator_debugging>off :
<define>_HAS_ITERATOR_DEBUGGING=0 
> ;
> 
> project
>      : requirements
>       
<library>/boost/test//boost_unit_test_framework
>        <link>static
>        # MSVC-8's iterator debugging causes some tests
to run forever.
>       
<toolset>msvc-8.0:<iterator_debugging>off
>      ;
> 
> test-suite "accumulators"
>      : [ run count.cpp ]
>        [ run covariance.cpp ]
> ...
>      ;


It works! You're a genius. And I see that puts the resulting
lib in a 
special iterator_debugging-off/ subdirectory, so other tests
that don't 
use this feature won't link to this special lib
inadvertently. Very nice.


-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )