|
Boost : |
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2020-05-18 10:26:05
On 2020-05-18 13:16, Alexander Grund via Boost wrote:
>
>>>>> As another note on that: I have a test to be run on windows only by
>>>>> using:
>>>>> <build>no <target-os>windows:<build>yes
>>>>>
>>>>> This now also breaks BJam as it sees a <build>no by the C++11
>>>>> requirements and a <build>yes by the above :(
>>>>> No idea how to solve that.
>>>
>>> This will get ugly here. I have 1 test which must only be build on
>>> Windows. ALL tests must only be build in C++11.
>>>
>>> Hence I would need to decorate _every_ test with the C++11
>>> requirement but that 1 test where I need to define a function that
>>> checks for the C++11 requirement _and_ if it is on Windows.
>>
>> The requirements specified for the project are applied to all targets
>> in the Jamfile. So you can apply the C++11 requirement to the project
>> and the Windows requirement to that one test.
> This is what I'm already doing, see above.
> The problem is that the project-wide C++11 requirement yields <build>no
> while the windows requirement yields <build>yes which causes a conflict
> and a hard error in B2:
>
> https://ci.appveyor.com/project/Flamefire/nowide-fr98b/builds/32945388/job/1wgu8f3emnjj6mna
>
>
> The relevant line is this:
> https://github.com/boostorg/nowide/blob/755dbe5255211677eebbe0a3795e44b1afb3ed79/test/Jamfile.v2#L45
The problem is that you have <build>no and <build>yes at the same time
on Windows. The conditional rule I suggested would produce no additional
properties on Windows (so that the test builds, provided that it is not
disabled by other requirements) and <build>no on other target systems.
rule check-windows ( properties * )
{
local result ;
if ! <target-os>windows in $(properties)
{
result = <build>no ;
}
return $(result) ;
}
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk