List Info

Thread: Re: propagating requirements to libraries




Re: propagating requirements to libraries
country flaguser name
United States
2007-04-04 13:11:47
Eric Niebler wrote:
> 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.
> 

I agree. This is a very important tip that will help avoid
linking 
incompatible libraries together. The same problem caused me
some major 
headaches in the past.

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

[1]

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