Boost logo

Boost-Build :

Subject: [Boost-build] "Recursion in main target references" problem
From: dimak (dvb.kharkov_at_[hidden])
Date: 2013-05-21 09:48:39


Hi guys,

I have the following blocker problem. Consider libraries "l1" and "l2" which
depend on each other (headers usage). And an application "app" uses the both
libraries. Layout:
app
-- Jamfile
-- app.cpp
l1
-- include
---- l1.h
-- Jamfile
-- l1.cpp
l2
-- include
---- l2.h
-- Jamfile
-- l2.cpp
Jamroot

*Content of Jamroot:*
/use-project /l1 : l1 ;
use-project /l2 : l2 ;

build-project app ;
/

To build "l1" I need headers of "l2" and vice verca. To build "app" both
headers and libraries of "l1" and "l2" are required. I have a simple
solution to build the project. The idea is to create alias with
"<include>include" usage requirement to be referenced by other library.

*Content of l1/Jamfile:*
/project
    : usage-requirements <include>include ;

lib mainlib1 : l1.cpp /l2//includes : <include>include ;
explicit mainlib1 ;

alias includes ;
explicit includes ;
/

*Content of l2/Jamfile:*
/project
    : usage-requirements <include>include ;

lib mainlib2 : l2.cpp /l1//includes : <include>include ;
explicit mainlib2 ;

alias includes ;
explicit includes ;/

*Content of app/Jamfile*
/exe app : app.cpp /l1//mainlib1 /l2//mainlib2 ;/

Now is the problem, finally :). I want to put <library> usage requirement to
both libraries so that "app" can define /l1//mainlib1 dependency and
/l2/mainlib2 automatically comes as a usage requirement. But I get the
following error in this case:
/home/dimak/install/bjam-trunk/build/targets.jam:589: in start-building from
module targets
error: Recursion in main target references
error: the following target are being built currently:
error: app/app l1/mainlib1 l2/mainlib2 l1/mainlib1
/home/dimak/install/bjam-trunk/build/targets.jam:718: in
class_at_main-target.generate from module object(main-target)@189
/home/dimak/install/bjam-trunk/build/targets.jam:874: in
targets.generate-from-reference from module targets
.......

Changed Jamfile-s of l1 and l2 are listed below.

*Content of l1/Jamfile:*
/project
    : usage-requirements <include>include ;

lib mainlib1 : l1.cpp /l2//includes : <include>include : :
<library>/l2//mainlib2 ;
explicit mainlib1 ;

alias includes ;
explicit includes ;
/

*Content of l2/Jamfile:*
/project
    : usage-requirements <include>include ;

lib mainlib2 : l2.cpp /l1//includes : <include>include : :
<library>/l1//mainlib1 ;

alias includes ;
explicit includes ;
/

Usage of <source> and <use> features instead of <library> has the same
effect. Guys could you please give me your advice? Please note that I
provide just a trivial example of the situation, in essense the problem
occurs in a complex bjam-based building system automatically generated from
Make-based building system where dependencies between the modules (libraries
and applications) are derermined by complex procedure.

Thank you for you time,
Dima

--
View this message in context: http://boost.2283326.n4.nabble.com/Recursion-in-main-target-references-problem-tp4647574.html
Sent from the Boost - Build mailing list archive at Nabble.com.

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