[cmake-developers] target_compile_features remaining issues
Stephen Kelly
steveire at gmail.com
Mon Apr 21 14:42:18 EDT 2014
Brad King wrote:
> Later CMake learns about the -std=c++11 flag for that compiler and
> honors the CXX_STANDARD request by passing it. Now the compiler
> has its extensions disabled and the project fails to build. This
> was due to an update in CMake, not the project.
Is the same problem present with CMAKE_*_COMPILE_OPTIONS_{PIE,PIC,DLL} ?
> We need a way for a project to say that it should not build unless
> CMake knows how to nominally enable support for the given language
> level.
This requirement is inconsistent with what people keep asking me for (namely
something like what the qmake CONFIG += c++11 does - enable a c++11 flag if
known, and do nothing if not), and is inconsistent with the decay- topic.
I think it be determined with code equivalent to
if (target->GetProperty("CXX_STANDARD" == std::string("11")
&& !makefile->GetDefinition("CMAKE_CXX11_STANDARD_COMPILE_OPTION"))
{
// FATAL_ERROR
}
We would need to know the compile options of compilers supported by existing
versions of CMake, and ensure that the option is recorded for new
CompilerIds and new releases of existing compiler ids too.
However, I guess two different interfaces are needed if you want to ensure
the 'require some notion of C++11' concept.
Thanks,
Steve.
More information about the cmake-developers
mailing list