|
Boost-Build : |
Subject: Re: [Boost-build] Built tools and cross compiling
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-12-19 12:44:18
AMDG
On 12/19/2015 06:46 AM, Tom wrote:
>
> I have tried it that way and the result is that the built
> tool ends up build for the target platform (see cross-final-b
> below :)
>
What I meant was essentially cross-final-c.
> I've updated the project with three targets: cross-final-a
> (the same as the previous cross-final), cross-final-b, and
> cross-final-c.
>
> The cross-final-b target has the cross target as a source with the
> <toolset>darwin property on it. The cross-final-b target sets a
> requirement on <toolset>darwin, which ends up causing the built
> tool to be built with darwin. Setting the default toolset on the
> command line has a similar effect as cross-final-b.
>
> However, given your response above, I tried a related approach
> of setting the requirements on both the cross target and the built
> tool target. The cross-final-c target sets the built tool's
> toolset to clang explicitly and sets a requirement on darwin for
> cross-final-c.
Setting clang on build_tool and using darwin on the
command line should also work.
> I did have to explicitly state the darwin version
> to get the cross-built targets into the same directory (one went
> into darwin-4.2.1 while the other went into darwin). Do you know
> why this would be the case?
>
It's a bug. targets.common-preoperties2 adds
default values to the build request before
handling the target's requirements. As a
result, the default toolset version isn't
applied when the toolset is changed in the
target requirements.
> This is similar to what what I tried in my more complicated project
> and it did not work. The difference was that in my project, I
> am using a new feature called platform to drive the requirements
> on targets built for the cross-platform. I also do not want to explicitly
> state the host platform's requirements since I'd like to build using
> several different host platforms.
What is the difference between platform and
host-os/target-os?
> Do you have an idea how this can
> be done in this example project? I don't want to modify the built
> tool's definition as it is correct (it has no requirements on anything
> but that stated). However, an alias for the built tool with an explicit
> requirement on the host platform (or in this case, clang) might do
> the trick. What do you think?
>
Yes, than should work.
> I'm going to try to add the platform feature to this mini-project to
> see if I can get what I want from that as well. I'll respond with
> the results.
>
In Christ,
Steven Watanabe
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