Thanks Volodya!

On 7 November 2014 01:01, Vladimir Prus <vladimir.prus@gmail.com> wrote:
On 11/06/2014 03:35 AM, Steve Lorimer wrote:
Hi all

We have multiple repos, each of which has their own Jamroot

We share some code between repos, so for example in a project Jamroot we'll have

    use-project /common : ../common/src ;


which pulls in common/src/Jamroot

We have a site-config.jam which configures our gcc toolchain etc, but the issue I'm having is specifying common requirements for our various
projects
Note below we have a number of repeated requirements. Is there a way to configure this in site-config.jam or somehow share the common parts?

*common/src/Jamroot:*

    project common
    : requirements
    <include>.
    <include>third_party
    <link>static
    <find-shared-library>pthread
    ;


*porject1/Jamroot:*

    project proj1
    : requirements
    <include>.
    <include>../common/src <include>../
    <include>../common/src/third_party
    <link>static
    <find-shared-library>pthread

    ;

Steve,

there are two methods that come to mind.

First, you can have your site-config.jam say this:

        constant COMMON_REQUIREMENTS : <link>static <find-shared-library>pthread ;

and then you can use $(COMMON_REQUIREMENTS) in each jamroot.

Second, you can create a custom module, say company.jam, make sure it's in BOOST_BUILD_PATH,
and add this to that module:

        rule common-requirements { return ... ; }

and then a jamroot can do:

        import company ;
       
        proejct proj1 : requirements ... [ company.common-requirements ] ;

On a final note, and somewhat related, what is the best practice for sharing code between repos / having multiple Jamroots etc?

I think the second approach will work.

HTH,
Volodya

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