Boost logo

Boost-Build :

Subject: [Boost-build] [run] propagate (usage)requirements to dependent targets
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2016-10-10 05:55:26


Hi all again,

I am still exploring a bit boost.build, so please have some patience
with me ...

I have a target to which I just added requirements and usage requirements:

exe smoke-ts-static : smoke-ts/basic-smoke-test.cpp
../build//boost_unit_test_framework/<link>static
                     : $(requirements_datasets)
                     :
                     : $(requirements_datasets) ; # usage requirements

where

requirements_datasets = [ requires cxx11_decltype cxx11_hdr_random
cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_variadic_macros
cxx11_trailing_result_types cxx11_template_aliases ] ;

and the following composite rule that is supposed to declare tests for
the binary being built above:

rule boost.test-smoke-ts-logger ( test-name-prefix : logger ? )
{
     logger ?= HRF ;

     to-return =
       [ run smoke-ts-static : --log_format=$(logger) : : :
$(test-name-prefix)-0 ]
       [ run smoke-ts-static : --log_format=$(logger) --log_level=all :
: : $(test-name-prefix)-1 ]
       [ run smoke-ts-static : --log_sink=smoke-ts-sink.$(logger)
--log_format=$(logger) : : : $(test-name-prefix)-2 ]
       [ run smoke-ts-static : --log_sink=smoke-ts-sink.$(logger)
--log_format=$(logger) --log_level=all : : : $(test-name-prefix)-3 ]
    ;
    return $(to-return) ;
}

When I run/build with C++11, everything works fine, but when the
requirement is not met with C++98, I have the following errors at first
[run] rule:

/Users/raffi/Personnel/boost_github/tools/build/src/build/generators.jam:994:
in try-one-generator-really
*** argument error
* rule class_at_generator.run ( project name ? : property-set : sources + )
* called with: ( object(project-target)@2140 bt-st-txml-0 :
object(property-set)@5559 : )
* missing argument sources

[snip]

I thought that usage-requirement will be propagated to the run rule.
What am I doing wrong and how to propagate the requirements?

I am declaring all I need in the following alias:

alias "smoke-ts"
:
   [ boost.test-smoke-ts-logger bt-st-txml : XML ]
   [ boost.test-smoke-ts-logger bt-st-thrf : HRF ]
   [ boost.test-smoke-ts-logger bt-st-tjunit : JUNIT ]
;

can the alias check for the usage requirements as well? How do I specify
that this alias should be generated only if the requirements of a
specific target are met?

Thanks,
Raffi


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