Boost logo

Boost :

Subject: Re: [boost] Boost tests with cmake
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2017-07-29 04:44:08


Accidentally replied to the wrong target.. Putting it back on dev list..

On Fri, Jul 28, 2017 at 11:27 PM, P F <pfultz2_at_[hidden]> wrote:

>
> On Jul 28, 2017, at 11:22 PM, Rene Rivera <grafikrobot_at_[hidden]> wrote:
>
> On Fri, Jul 28, 2017 at 11:01 PM, P F <pfultz2_at_[hidden]> wrote:
>
>>
>> > On Jul 28, 2017, at 7:25 PM, Rene Rivera via Boost <
>> boost_at_[hidden]> wrote:
>> >
>> > The predef script is incorrect. This <
>> > https://github.com/pfultz2/boost-cmake-demo/blob/bcm-test-
>> demo/libs/predef/test/CMakeLists.txt#L25>
>> > is not equivalent to the original <
>> > https://github.com/pfultz2/boost-cmake-demo/blob/bcm-test-
>> demo/libs/predef/test/build.jam#L60>.
>> > As the "-DCHECK_VALUE=true" is not passed to compiler in response to the
>> > evaluation of '"BOOST_COMP_CLANG > 0.0.0" "BOOST_OS_LINUX == 0"'. It
>> needs
>> > to try to compile and run one of the programs from here <
>> > https://github.com/pfultz2/boost-cmake-demo/tree/bcm-test-
>> demo/libs/predef/tools/check>.
>> > The test is verifying that both this <
>> > https://github.com/pfultz2/boost-cmake-demo/blob/bcm-test-
>> demo/libs/predef/tools/check/predef.jam>
>> > and this <
>> > https://github.com/pfultz2/boost-cmake-demo/blob/bcm-test-
>> demo/libs/predef/tools/check/predef_check.h>
>> > work as expected. For cmake you would need still need to test the
>> latter,
>> > still.
>>
>> Yes, I need to add a custom function `predef_check` in cmake to support
>> this,
>
>
> Right.
>
>
>> although it would be best to do the detection directly in cmake rather
>> than through the running the tool
>
>
> Not sure what you mean by that.
>
>
> Because when cross compiling you can’t always run the executable, and
> using a host compiler seems it would be give different results than the
> target compiler. However, a preprocessor expression can be evaluated
> through cmake’s try compile, which will safely work with cross compiling.
> Perhaps this is what bjam’s rule does already.
>

Sorry.. I misspoke. They are compile checks, not run checks. If the compile
succeeds (of one of the "predef_check_cc_as_*.*") it needs to add the
"-DCHECK_VALUE=true" to the compile and run of "check_value.cpp". But the
test data in this case would also need to change if you are going to use a
try-compile target. As the b2 code parses out those strings and
reformulates them as a -DCHECK=.. compile option.

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk