cmake forces c++11 on an app that needs c++14

Stephen Kelly steveire at gmail.com
Fri Jun 10 17:22:00 UTC 2016


David Faure wrote:

> On dimanche 5 juin 2016 11:27:48 CEST Stephen Kelly wrote:
>> On 06/04/2016 11:03 AM, David Faure wrote:
>> > Symptom: zanshin doesn't compile with Qt 5.7 and cmake from "release"
>> > branch, error is "std::make_unique not found".
>> > 
>> > Reason: zanshin wants -std=c++14, but gets a compile line like this:
>> > -std=c++0x [...] -std=c++14 [...] -std=gnu++11
>> > so in the end only C++11 is enabled, not C++14.
>> > 
>> > In order to enable C++14, Zanshin does this:
>> > set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
>> 
>> This is likely:
>> 
>>  https://bugreports.qt.io/browse/QTBUG-53002
>> 
>> I don't know where the -std=c++0x comes from in your compile line
>> (something in ECM?)
> 
> Indeed.
> 
> kde-modules/KDECompilerSettings.cmake:    set(CMAKE_CXX_FLAGS "$
> {CMAKE_CXX_FLAGS} -std=c++0x")
> 
> Should we only do this if cmake < 3.1 ?

My preference is to require CMake 3.1 or later and remove that.

I expect that version bump to be unpopular for not-good reasons (debian 
stable doesn't have 3.1 I think, but IMO that's not a good reason to hold 
back), so I haven't tried to set the requirement to that.

Grantlee depends on CMake 3.1.

Thanks,

Steve.




More information about the Kde-buildsystem mailing list