|
Boost-Build : |
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2006-11-15 19:03:25
Vladimir Prus wrote:
> Attached is a patch to implement 'toolset requirements' -- a mechanism for
> toolset to say "on msvc, with dynamic runtime, use multi-threading". The
> approach is damn simple -- there's global list of requirements that toolset
> modules append to. The list is appended to requirements of all main targets,
> as if that list was specified in their requirements.
>
> With this patch, building with msvc starts using threading=multi.
>
> If nobody has any objections to this patch, I'll commit it.
As I mentioned on IM, I tried using this to replace the GCC toolset
logic for static vs. dynamic runtime vs. link generator logic. But it's
not currently possible AFAICT. I tried adding:
rule check-runtime-link-static ( properties * ) ...
toolset.add-requirements
<conditional>@gcc.check-runtime-link-static
;
That fails because it seems that conditional rules only work if they are
defined in the Jamfile context for the main targets. But that was after
trying a more specific:
toolset.add-requirements
<toolset>gcc,<target-os>unix,<runtime-link>static:<conditional>@gcc.check-runtime-link-static
<toolset>gcc,<target-os>linux,<runtime-link>static:<conditional>@gcc.check-runtime-link-static
;
As conditional requirements are not themselves conditional. Not a big
problem onto itself, it's just that it make the rule itself more compact
if the above where possible.
Now if you ask why use a conditional rule: It allows for spitting out an
informative message as to why it's going to add the "<build>no".
I'll see how much farther I can get without using a rule.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo
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