[cmake-developers] Wrong cxx-extension flags
Kornel Benko
kornel at lyx.org
Thu Jul 14 13:59:52 EDT 2016
Am Donnerstag, 14. Juli 2016 um 13:35:06, schrieb Brad King <brad.king at kitware.com>
> On 07/14/2016 01:13 PM, Kornel Benko wrote:
> > -- The CXX compiler identification is GNU 6.1.0
> > -- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=gnu++11
> > I expected here "-- CMAKE_CXX11_EXTENSION_COMPILE_OPTION = -std=c++14".
>
> That is the option for C++11 with extensions. See
> CMAKE_CXX14_EXTENSION_COMPILE_OPTION for C++14 with extensions.
> Both of these are internal table entries for CMake's generators
> and not meant for direct use by projects.
>
> What are you actually trying to do?
>
> -Brad
I was trying to compile lyx with QT5.7.
The effect was, that the compilation failed. Searching for a reason I found that the flags in the flag.cmake files were mismatched.
Here one example:
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.6
# compile CXX with /usr/local/gcc6.1/bin/g++
CXX_FLAGS = -Wall -Wunused-parameter --std=c++14 -fno-strict-aliasing -Wall -Wunused-parameter --std=c++14 -fno-strict-aliasing -O0 -g3 -D_DEBUG -DBOOST_USER_CONFIG="<config.h>" -fPIC --std=gnu++11
...
Therefore I started searching, where the extra ' --std=gnu++11' came from, and found it in Modules/Compiler/GNU-CXX.cmake.
To verify, I made the output of this variable.
To be clear, I did not want to do anything with the variable CMAKE_CXX14_EXTENSION_COMPILE_OPTION.
Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160714/7c7ebe84/attachment.sig>
More information about the cmake-developers
mailing list