Boost logo

Boost-Build :

From: Daniel Einspanjer (deinspanjer_at_[hidden])
Date: 2006-02-10 09:47:26


Wow. Thanks for the detailed reply!

"Vladimir Prus" <ghost_at_[hidden]> wrote in message
news:200602101146.08385.ghost_at_cs.msu.su...

> That's just fine, if the build platform and the target platforms is the
> same
> -- which is the case now since we don't, at least officially, support
> cross-compiling.

Would the right way to support a cross-compilation-aware BB be the first
method of using empty aliases and alternatives?

>> and it almost works, but since we don't have any NT specific files, the
>> rule bombs out.
>
> Ah, true, but what do you want in that case? Skip building of 'example2'
> completely? Then, you can either wrap it in "if [ os.name ] = NT", or you
> can
> use newly introduced <build>no properties:
>

My example was a bit contrived here. In reality, these source files get
compiled into a lib that has other source files that are always part of it.
I trimmed a bit too much away to give a clear representation.

> or you can combine indirect conditional requirements with <build>on and
> the
> <source> feature like this:

I tried implementing this method with the following code. I used an
intermediate obj target so I could have the <build>no stop it but not the
parent. It works, but I did notice something a bit strange. The Skipping
message appears *very* early in the build progress.. While it is very clear
in its statement, I think it might be just a bit disconcerting when one of
my developers sees it at the top of a Windows build.

rule select_platform_specific_sources ( properties * )
{
    if <os>NT in $(properties)
    {
        return <build>no ;
    }
    else if <os>LINUX in $(properties)
    {
        return <source>linux.cpp ;
    }
    else if <os>OSXPPC in $(properties)
    {
        return <source>osxppc.cpp ;
    }
}
obj platform_specific_sources
    : # sources
    : # requirements
        <conditional>@select_platform_specific_sources
    ;
lib util
    : # sources
        #... normal sources here
        platform_specific_sources
    : # requirements
    ;
[C:\src\testproj\engine\cpp\util\common]bjam util
Skipping build of
../../../../engine/cpp/util/common/platform_specific_sources -- <build>no in
properties.
...patience...
...found 468 targets...
...updating 91 targets...
MkDir1 ..\..\..\..\product\build

Does it seem right to you that the Skipping message appears so early?

Daniel


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