Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2003-10-11 13:56:45


[Moving this to jamboost list]

[2003-09-29] John Maddock wrote:

>
>> Weird. I made a change not long ago which *fixed* the way <template>s
>> worked so that templates in other subprojects could be referenced
>> (boost-base.jam v. 1.103). I can't understand how that would break
>> your usage.
>>
>> What -I options *do* you see in your command lines (bjam -n -a), and
>> what do you *expect* to see?
>
>Well for example I see:
>
> "cl" /Zm800 -nologo -GX -c /Z7 /Od /Ob0 /GX /GR /MDd /Op
>/Zc:wchar_t,for Scope -I"..\..\bin\boost\libs\regex\build" -I"C:\Program
>Files\Microsoft Visual Studio .NET
>03\VC7\include"
-Fo"..\..\bin\boost\libs\regex\build\libboost_regex.lib\vc
>7.1\debug\threading-multi\regex.obj"
-Tp"c:\data\boost\develop\boost\libs\r
>egex\build\../src/regex.cpp"
>
>Notice for example that $(BOOST_ROOT) is not in the include path (actually
>none of the options applied via the template are getting applied, it should
>look like this:
>
> "cl"
> /Zm800 -nologo -GX -c -DBOOST_REGEX_CONFIG_INFO=1 -DBOOST_REGEX_NO_LIB=1
>/Z7 /Od /Ob0 /GX /GR /MDd /Op /Zc:wchar_t,forScope -I"..\..\..\bin\boost\
>libs\regex\build" -I"c:\data\boost\develop\boost" -I"C:\Program
>Files\Microsoft Visual Studio .NET
>03\VC7\include"
-Fo"..\..\..\bin\boost\libs\regex\build\libboost_regex.lib
>\vc7.1\debug\c_regex_traits.obj"
-Tp"..\..\..\libs\regex\build\../src/c_reg
>ex_traits.cpp"
>
>>
>> What happens when you roll that change back?
>
>No joy, it's not that change that broke things.
>
>I tried rolling back further, but that only produced errors within the Jam
>system.

Well it took me a while to figure this one out. And as it turns out it's not
a bug in Boost.Build. The problem is in the way you are expecting <template>
to work. The basic problem is that you are refering to templates as global
entities:

<template>regex-options

But templates are targets, and have to be referenced just like other
targets. And they live in a single sub-project (Jamfile). To fix the problem
you should:

1. Only define the template in one place, like in libs/regex/build. By
only including the base.jam from the Jamfile in libs/regex/build, and
removing any other includes of that file.

2. Changing references to the templates to use the single targets. For
example changing the reference in libs/regex/example/Jamfile from
<template>regex-options, to <template>../build/regex-options.

I did such changes on my local copy, and they fix the missing options when
using the Jamfile you mentioned (libs/regex/Jamfile).

PS. The base.jam use normally works because it gets included template
targets are generated in the including Jamfile. But now that "import" guards
against multiple inclusion the multiple reference to the templates refer to
non-existant targets.

-- grafik - Don't Assume Anything
-- rrivera (at) acm.org - grafik (at) redshift-software.com
-- 102708583 (at) icq

 


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