[cmake-developers] target_compile_features remaining issues

Stephen Kelly steveire at gmail.com
Thu Apr 10 04:44:33 EDT 2014


Rolf Eike Beer wrote:

> Am 08.04.2014 11:43, schrieb Stephen Kelly:
>> Rolf Eike Beer wrote:
>> 
>>>> Of course, it is easier to get features into the
>>>> CMAKE_CXX_KNOWN_FEATURES
>>>> list when there is only one compiler to test for on the dashboard.
>>>> I'll
>>>> add one C++98 feature to establish the infrastructure, but I don't
>>>> intend
>>>> to be exhaustive about C++98 features. If you or anyone else has an
>>>> interest in doing so, I'd recommend getting them in early.
>>> 
>>> Cool. I think it would be good to get the stuff that is enabled by the
>>> "-AA +hpxstd98" calls on HP-UX 11i into such a feature so we can make
>>> the
>>> "complex" testcase just select whatever is needed automatically
>>> instead of
>>> fiddling around to get the magic flags getting passed into that test
>>> to
>>> make the C++ compiler behave like something useful.
>> 
>> Ok, I don't know anything about the features or flags of that compiler.
>> 
>> What features do you have in mind to add?
> 
> Working <iostream> (IIRC), or anything in std namespace. Basically it
> looks like the old HP compiler needs +hpxstd98 as compile flag to behave
> like a C++98 compiler at all, likely because that compiler line is
> indeed older than 1998 and that simply is not the default as for later
> versions of that compiler. And the -AA flag is also needed for, uhm,
> something, at least CMake doesn't build without it.

So far, features which have been added are related to the compiler (driver), 
not the standard library. I've deliberately not considered stdlib features 
because I don't know how much slower that would make the feature checks. You 
would have to run many compile tests. Currently, features are recorded by a 
single compilation which checks preprocessor defines.

I'm not convinced this features system is the right tool to solve your HP 
stdlib problem. cxx_working_iostreams or cxx_working_stdlib are not features 
I envisioned adding when designing it. 

I suggest considering alternative solutions, such as simply adding both 
flags in the Compiler/HP.cmake file, a target property or a variable.

Thanks,

Steve.





More information about the cmake-developers mailing list