[cmake-developers] Please review CXXFeatures.cmake

Rolf Eike Beer eike at sf-mail.de
Thu Aug 8 10:56:55 EDT 2013


Brad King wrote:
> On 08/01/2013 04:47 PM, Rolf Eike Beer wrote:
>> Alexander Neundorf wrote:
>>> I'm not sure I would have made this a find-module, instead of a 
>>> simple
>>> module which can be included and then provides a function, but I 
>>> think this
>>> doesn't matter much.
>> 
>> Because I get things like components for free then ;)
> 
> Since it looks like a find module it is running as part of
> the all-find-modules tests:
> 
>  Tests/FindModulesExecuteAll/CMakeLists.txt
>  Tests/CMakeOnly/AllFindModules/CMakeLists.txt
> 
> Since this module is not really a find module and already
> has its own dedicated Module.CXXFeatures test, please teach
> the above two tests to skip it.

Ok, I'll move the test from Tests/Module/CXXFeatures to 
Tests/Module/FindCXXFeatures and then tell those tests to ignore any 
Find* in that directory.

> ---------------------------------------------------------------------
> 
> All three above tests are timing out on the Watcom build:
> 
>  http://open.cdash.org/viewTest.php?onlyfailed&buildid=2992340
> 
> Watcom interactively prompts in some error cases so it times
> out the automated tests.  I've finally just taken the time to
> figure out how to suppress the prompt which I'll add in another
> topic.  Anyway, the error occurs in one of the try_compile checks:
> 
>  [100%] Building CXX object
> CMakeFiles/cmTryCompileExec1059188181.dir/src.cxx.obj
>  Error! E059: unable to open 'd=c++11'
> 
> The corresponding flags.make has:
> 
>  CXX_FLAGS =  -w=3 -xs -D_HAS_CXX11_FLAG -br -bm -d2   -std=c++11
> 
> The wcl386 compiler help shows
> 
>  -st touch stack through SS first
> 
> You may need to hard-code answers for some compilers.
> 
> ---------------------------------------------------------------------

Bug 14339, add Watcom I think.

> What is the expected behavior if one writes
> 
>  find_package(CXXFeatures QUIET)
> 
> ?  If this is supposed to be a find module then it should not
> have guaranteed failure cases like this:
> 
>  if (NOT CMAKE_CXX_COMPILER_LOADED)
>      message(FATAL_ERROR "CXXFeatures modules only works if language
> CXX is enabled")
>  endif ()
> 
> It should respond with NOTFOUND for everything if CXX is not
> enabled IMO.

Well, including this module without a C++ compiler just can't work. 
Adding such a QUIET-bypass is possible, but I don't see a value in it. 
This case an only happen if one explicitely disables C++ and later 
conditionally enables it. But this conditionally (i.e. if(...)) could 
also cover the call to this module. This also breaks if you do 
find_package(Qt4 QUIET) without C++ enabled, and probably others 
(Boost?).

Eike



More information about the cmake-developers mailing list