Boost logo

Boost :

Subject: Re: [boost] [build] adding a rquirement for Cygwin only?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-03-05 12:11:32


On 03/05/2015 09:37 AM, Peter Dimov wrote:
> Steven Watanabe wrote:
>> The correct <target-os> for Cygwin should be cygwin, not windows. The
>> problem is that target-os is not auto-detected and defaults to being
>> the same as host-os.
> Thanks, but this doesn't solve my problem. What I think you're saying is
> that I should pass target-os=cygwin. But I can't do that in my use case,
> which is going into a library's test directory and typing
> b2
> toolset=clang,clang-cxx11,gcc,gcc-cxx11,msvc-8.0,msvc-10.0,msvc-11.0,msvc-12.0
> When a test depends on Boost.Thread, it tries to build it, and that
> fails on Cygwin.
> I could split the above into two lines, but it would've been nice for
> Cygwin to work out of the box with Boost.Thread. This is why I've been
> trying to come up with a way to change Boost.Thread's Jamfile to use
> <threadapi>pthread on Cygwin and the default <threadapi> on MinGW.

Last time I used Cygwin (which was admittedly a long time ago)
I put something like this in my user-config.jam:

import toolset ;
using gcc ;
toolset.add-requirements <toolset>gcc:<target-os>cygwin ;

You could also split the command line arguments like this:

b2 toolset=msvc-8.0,msvc... toolset=gcc/target-os=cygwin

Actually... I seem to recall that Boost.Thread's Jamfile
doesn't work correctly even if target-os is set. It
sets the default threadapi entirely based on the host.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at