Bug 340831 - Error on emerge kdevelop in kcwsh
Summary: Error on emerge kdevelop in kcwsh
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kde-windows
Classification: Unmaintained
Component: other (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-10 19:37 UTC by Michael Gooch
Modified: 2015-10-11 14:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
CMakeLists from tset directory, with the change I made (607 bytes, text/plain)
2014-11-10 21:35 UTC, Michael Gooch
Details
fixes the compiler flag for the affected target (980 bytes, patch)
2014-11-11 20:27 UTC, Michael Gooch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gooch 2014-11-10 19:37:39 UTC
[ 79%] [ 82%] Building CXX object tests/CMakeFiles/terminaltest.dir/terminaltest.cpp.obj
Building CXX object tests/CMakeFiles/terminaltest.dir/terminaltest_automoc.cpp.obj
q:\kcwsh\tests\terminaltest.cpp: In constructor 'TestTerminal::TestTerminal()':
q:\kcwsh\tests\terminaltest.cpp:61:52: error: 'nullptr' was not declared in this scope
 TestTerminal::TestTerminal() : Terminal(), m_timer(nullptr) {
                                                    ^
q:\kcwsh\tests\terminaltest.cpp: In member function 'void TestTerminal::startCmdDelayed(std::vector<std::basic_string<wchar_t> >, int)':
q:\kcwsh\tests\terminaltest.cpp:66:19: error: 'nullptr' was not declared in this scope
     if(m_timer != nullptr) {
                   ^
q:\kcwsh\tests\terminaltest.cpp: In member function 'virtual void TestTerminal::sizeChanged()':
q:\kcwsh\tests\terminaltest.cpp:138:34: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     c = { 80, 25 };
                                  ^
q:\kcwsh\tests\terminaltest.cpp:138:23: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     c = { 80, 25 };
                       ^
q:\kcwsh\tests\terminaltest.cpp:140:44: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 162, 52 };
                                            ^
q:\kcwsh\tests\terminaltest.cpp:140:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 162, 52 };
                                ^
q:\kcwsh\tests\terminaltest.cpp:145:44: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 160, 50 };
                                            ^
q:\kcwsh\tests\terminaltest.cpp:145:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 160, 50 };
                                ^
q:\kcwsh\tests\terminaltest.cpp:150:49: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 10000, 10000 }; // we want to restrict to the maximum size now
                                                 ^
q:\kcwsh\tests\terminaltest.cpp:150:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                     m_testSize = { 10000, 10000 }; // we want to restrict to the maximum size now
                                ^
q:\kcwsh\tests\terminaltest.cpp: In function 'int main()':
q:\kcwsh\tests\terminaltest.cpp:220:33: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
         t.m_testSize = { 80, 25 };
                                 ^
q:\kcwsh\tests\terminaltest.cpp:220:22: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
         t.m_testSize = { 80, 25 };
                      ^
jom: R:\build\testing\kcwsh\work\mingw-w64-RelWithDebInfo-gitHEAD\tests\CMakeFiles\terminaltest.dir\build.make [tests\CMakeFiles\terminaltest.dir\terminaltest.cpp.obj] Error 1
jom: R:\build\testing\kcwsh\work\mingw-w64-RelWithDebInfo-gitHEAD\CMakeFiles\Makefile2 [tests\CMakeFiles\terminaltest.dir\all] Error 2
jom: R:\build\testing\kcwsh\work\mingw-w64-RelWithDebInfo-gitHEAD\Makefile [all] Error 2
emerge warning: while running make cmd: jom
emerge error: fatal error: package testing/kcwsh all failed

Reproducible: Always

Steps to Reproduce:
emerge konsole

Actual Results:  
error as above

Expected Results:  
proper compilation of dependencies and konsole itself
Comment 1 Michael Gooch 2014-11-10 19:42:46 UTC
on a quick review it looks like the cmake file simply needs the cpp flag -std=c++11 added
Comment 2 Michael Gooch 2014-11-10 19:56:46 UTC
I am not quite sure how to find the required cmake file, as I am not accustomed to the buildsystems that kde-windows porting uses, but I am trying nonetheless in the interest of testing if my assessment is accurate
Comment 3 Michael Gooch 2014-11-10 21:04:14 UTC
adding -std=c++11 to the CXXFLAGS variable in r:\build\testing\kcwsh\work\mingw-w64-RelWithDebInfo-gitHEAD\tests\CMakeFiles\terminaltest.dir\flags.make allows this package to compile, but I'm as of yet not sure where I'm supposed to put that flag within the *.cmake files to make it generate the make files containing that flag to begin with.
Comment 4 Michael Gooch 2014-11-10 21:33:07 UTC
adding set_target_properties(terminaltest PROPERTIES COMPILE_FLAGS "-std=c++11")

between lines 10 and 11 in Q:\kcwsh\tests\CMakeLists.txt seems to fix this
Comment 5 Michael Gooch 2014-11-10 21:35:47 UTC
Created attachment 89524 [details]
CMakeLists from tset directory, with the change I made
Comment 6 Michael Gooch 2014-11-10 21:38:53 UTC
that fix will probably need to be adapted somehow to accomodate people using MS visual compilers
Comment 7 Kevin Funk 2014-11-11 10:33:34 UTC
Simply add this to the root CMakeLists.txt:

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()


Does that help?
Comment 8 Michael Gooch 2014-11-11 20:15:50 UTC
That will probably work Kevin, should just leave this to the devs to implement how they want at this point I guess. It got me past that package build at the very least. (i'm using mingw myself)
Comment 9 Michael Gooch 2014-11-11 20:27:59 UTC
Created attachment 89543 [details]
fixes the compiler flag for the affected target

needs confirmatory testing and a second look to determine i didn't mess it up, but it ought to work properly.
Comment 10 Kevin Funk 2014-11-12 09:22:57 UTC
This is Patrick's baby, so I leave the decision for him. But I'd use my solution and just enable C++11 globally. Otherwise you end up doing set_target_properties for every target when you use C++11 features more and more.
Comment 11 Sven Brauch 2015-10-11 14:44:15 UTC
I don't think it makes sense to have this lying around as an open bug, I'll close it