Boost logo

Boost-Build :

From: Dave Rahardja (drahardja_at_[hidden])
Date: 2007-04-10 10:43:45


It seems that include paths that end with a directory name completely
enclosed in (parentheses) will cause the previous directory separator to be
dropped.

For instance:

----- Jamroot -----
local DIRS
    = foo/(bar) # <--- here's the problem
        foo/(bar)/baz
        foo/(bar
        foo/bar)
        foo/(bar)z
        foo/z(bar)
    ;

exe foobar
    : foo/(bar)/bar.cpp
    : <include>$(DIRS)
    ;

----- mytool.jam -----
import feature ;
import toolset : flags ;

feature.extend toolset : mytool ;

rule init ( version ? : command * : options * )
{
}

generators.register-c-compiler mytool.compile.c++ : CPP : OBJ :
    <toolset>mytool ;
generators.register-linker mytool.link : OBJ : EXE : <toolset>mytool ;

flags mytool.compile.c++ INCLUDES <include> ;

rule compile.c++ ( targets + : sources * : properties * )
{
}

rule link ( targets + : sources * : properties * )
{
}

actions together compile.c++
{
    echo -I$(INCLUDES)
    copy $(>) $(<)
}

actions link
{
    copy $(>[1]) $(<)
}

---------------------------

Invoking the tool on the command line:

>bjam toolset=mytool -a
...found 8 targets...
...updating 2 targets...
mytool.compile.c++ bin\mytool\debug\bar.obj
-Ifoo(bar) -Ifoo\(bar -Ifoo\(bar)\baz -Ifoo\(bar)z -Ifoo\bar)
        1 file(s) copied.
mytool.link bin\mytool\debug\foobar.exe
        1 file(s) copied.
...updated 2 targets...

Notice that the first include statement has dropped the backslash before
(bar), i.e. it should say -Ifoo\(bar) instead of -Ifoo(bar).

Note also that the problem only occurs if the ENTIRE last component of the
path is enclosed in parentheses.

-dr


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