Re: [boost] Boost tests with cmake
Accidentally replied to the wrong target.. Putting it back on dev list..
On Fri, Jul 28, 2017 at 11:27 PM, P F
On Jul 28, 2017, at 11:22 PM, Rene Rivera
wrote: On Fri, Jul 28, 2017 at 11:01 PM, P F
wrote: On Jul 28, 2017, at 7:25 PM, Rene Rivera via Boost < boost@lists.boost.org> 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
participants (1)
-
Rene Rivera