Boost logo

Boost-Build :

Subject: [Boost-build] Cannot define alias with usage-requirements without recursion in target references
From: Gavin Beatty (gavinbeatty_at_[hidden])
Date: 2011-09-14 12:07:31


Hello

I have a project structure like:
Jamroot
x_proj/Jamfile
app.cpp

:Jamroot:
use-project /proj : ./x_proj ;
project : requirements <use>/proj//headers ;
exe app : app.cc ;

:x_proj/Jamfile:
alias headers : : : : <include>/some/path ;
explicit headers ;

But bjam outputs
/usr/local/boost-build/build/targets.jam:543: in start-building from
module targets
error: Recursion in main target references
error: the following target are being built currently:
error: ./app /home/gbeatty/work/recursejam/x_proj/headers
/home/gbeatty/work/recursejam/x_proj/headers
/usr/local/boost-build/build/targets.jam:728: in
object(main-target)@53.generate from module object(main-target)@53
/usr/local/boost-build/build/targets.jam:883: in
targets.generate-from-reference from module targets
/usr/local/boost-build/build/targets.jam:1168: in
generate-dependencies from module object(alias-target-class)@52
/usr/local/boost-build/build/targets.jam:1216: in
object(alias-target-class)@52.generate from module
object(alias-target-class)@52
/usr/local/boost-build/build/targets.jam:767: in generate-really from
module object(main-target)@53
/usr/local/boost-build/build/targets.jam:739: in
object(main-target)@53.generate from module object(main-target)@53
/usr/local/boost-build/build/targets.jam:883: in
targets.generate-from-reference from module targets
/usr/local/boost-build/build/targets.jam:1168: in
generate-dependencies from module object(typed-target)@18
/usr/local/boost-build/build/targets.jam:1216: in
object(typed-target)@18.generate from module object(typed-target)@18
/usr/local/boost-build/build/targets.jam:767: in generate-really from
module object(main-target)@43
/usr/local/boost-build/build/targets.jam:739: in
object(main-target)@43.generate from module object(main-target)@43
/usr/local/boost-build/build/targets.jam:257: in
object(project-target)@16.generate from module
object(project-target)@16
/usr/local/boost-build/build-system.jam:682: in load from module build-system
/usr/local/boost-build/kernel/modules.jam:283: in import from module modules
/usr/local/boost-build/kernel/bootstrap.jam:138: in boost-build from module
/usr/local/boost-build/boost-build.jam:8: in module scope from module

However, putting the <include> directly in the global project line
works just fine. I've tried defining /proj/headers as a project with
usage-requirements and using <source> instead of <use>. Only defining
the headers target in Jamroot has worked.

Does anyone have a solution? Am I wrong in trying to use use-project and alias?

Boost.Build V2 (Milestone 12)
Boost.Jam 03.1.17

The reason I really want this structure, is I want to define some
rather tedious include directories in an alias in a separate Jamfile,
so it can be a separately versioned svn:external. So defining the
alias in Jamroot or setting the <include> properties directly there
isn't really an option.

Cheers,
 -Gavin

-- 
Gavin Beatty
SEMPER UBI SUB UBI

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