Boost logo

Boost-Build :

From: Kevin Wheatley (hxpro_at_[hidden])
Date: 2005-12-14 11:08:17


I have a project something like this...

local srcdir = src ;
local includedir = include ;

rule run-tests ( sources * : extra-sources * : requirements * )
{
    for local s in $(sources)
    {
        local testexe = [ MATCH ^(.+)\..+$ : $(s) ] ;
        unit-test $(testexe) : $(s) $(extra-sources) /boost//test
/testing//usage-requirements : $(requirements) ;
    }
}

run-tests [ glob tests/*_tests.cpp ]
        : mylibrary
        : <include>$(includedir)
          <include>../lib/tests
        ;

lib mylibrary
        : [ glob $(srcdir)/*.cpp ]
        : <link>static
          <include>$(includedir)
          <library>/MyProject/lib//sometargetlibrary
        :
        : <include>$(includedir)
          <library>/boost//filesystem
        ;

Assume all the missing bits are there if you like :-)

When linking the unit-test, the order of the libraries in the link
line appears to me to be backwards from what I'd like

"g++" -o
"/images/WorkingSVN/MyProject/mylibrary/tests/mylibrary_tests.c"
"../../MyProject/bin/mylibrary/gcc-3.2/debug/threading-multi/mylibrary_tests.o"
"/data/RnD/3rdPartyLibraries/www.boost.org/boost_1_33_1_gcc_3.2.3/lib/libboost_unit_test_framework-gcc-mt-d-1_33_1.a"
"/data/RnD/3rdPartyLibraries/www.boost.org/boost_1_33_1_gcc_3.2.3/lib/libboost_filesystem-gcc-mt-d-1_33_1.a"
"../../MyProject/bin/mylibrary/gcc-3.2/debug/link-static/threading-multi/libmylibrary.a"
"../../MyProject/bin/lib/gcc-3.2/debug/link-static/threading-multi/libsometargetlibrary.a"
"/data/RnD/3rdPartyLibraries/www.boost.org/boost_1_33_1_gcc_3.2.3/lib/libboost_filesystem-gcc-mt-d-1_33_1.a"
-lrt -g -pthread

i.e. the /boost//filesystem usage-requirement I'd expect to occur
*after* the mylibrary target in the link command so that the symbols
are correctly found. Is there a reason for this ordering (other than
thats how its implemented :-)

CVS HEAD from yesterday afternoon, linux, gcc 3.2.3, Boost 1.33.1
release

Thanks

Kevin

-- 
| Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this      |
| Senior Technology                     | My employer for certain |
| And Network Systems Architect         | Not even myself         |

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