Bug 307866

Summary: kwin fails to build when the GLES support is disabled
Product: [Plasma] kwin Reporter: Jekyll Wu <adaptee>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git master   
Target Milestone: 4.10   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10
Sentry Crash Report:
Attachments: the full build log
Add missing parameter to function declaration
Proposed patch

Description Jekyll Wu 2012-10-04 20:51:25 UTC
The related error message:

    Scanning dependencies of target kcm_kwindecoration
    Scanning dependencies of target kcm_kwin4_effect_builtins
    /tmp/portage/kde-base/kwin-9999/work/kwin-9999/kwin/libkwineffects/kwinglutils.cpp: In function ‘void KWin::initGL(KWin::OpenGLPlatformInterface)’:
    /tmp/portage/kde-base/kwin-9999/work/kwin-9999/kwin/libkwineffects/kwinglutils.cpp:111:41: error: too many arguments to function ‘void KWin::glResolveFunctions()’
    /tmp/portage/kde-base/kwin-9999/work/kwin-9999/kwin/libkwineffects/kwinglutils_funcs.h:78:18: note: declared here
    make[2]: *** [kwin/libkwineffects/CMakeFiles/kwinglutils.dir/kwinglutils.o] Error 1
    make[1]: *** [kwin/libkwineffects/CMakeFiles/kwinglutils.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....


I'm building kwin from commit 1f468d60f0f79a9ba00347b46abaa765757aa62d


Reproducible: Always
Comment 1 Jekyll Wu 2012-10-04 20:55:44 UTC
Created attachment 74341 [details]
the full build log
Comment 2 Thomas Lübking 2012-10-04 23:14:27 UTC
try copying line 360
void KWIN_EXPORT glResolveFunctions(OpenGLPlatformInterface platformInterface);
to line 78
void KWIN_EXPORT glResolveFunctions();

in kwin/libkwineffects/kwinglutils_funcs.h

Actually it looks (but it's late) like the GLX path should not compile at all (i compile both) but for some reason does *shrug*
Comment 3 Martin Flöser 2012-10-05 06:21:05 UTC
how did you disable GLES support? Looking at the build log GLES is found and KWin now uses EGL also for OpenGL.
Comment 4 Jekyll Wu 2012-10-05 07:42:38 UTC
I'm using  Gentoo now, so I disable it through USE flag like "opengl -gles" .  Its related ebuild part is :

        mycmakeargs=(
                $(cmake-utils_use_with gles OpenGLES)
                $(cmake-utils_use gles KWIN_BUILD_WITH_OPENGLES)
                $(cmake-utils_use_with opengl OpenGL)
                -DWITH_X11_Xcomposite=ON
       )

That should translate to 

      -DWITH_OpenGLES=OFF -DKWIN_BUILD_WITH_OPENGLES=OFF -DWITH_OpenGL=ON -DWITH_X11_Xcomposite=ON

, as recorded  in the build log.
Comment 5 Martin Flöser 2012-10-05 07:53:35 UTC
seems like it finds the EGL libs although OpenGLES is disabled. My CMake knowledge is too limited to know whether this is the expected behavior.

But anyway: that ebuild part needs to be reworked. It's outdated. E.g. KWIN_BUILD_WITH_OPENGLES does not exist anymore. The currently supported build options are documented in http://techbase.kde.org/Projects/KWin/Build_Options
Comment 6 Jeremy Whiting 2012-10-05 16:35:12 UTC
Created attachment 74361 [details]
Add missing parameter to function declaration

This fixes the build here, though I'm not on gentoo like the original reporter.
Comment 7 Martin Flöser 2012-10-06 08:25:45 UTC
the patch from comment#6 unfortunately would result in a compile error if GLES is available. I'm just testing a patch which hopefully works for both :-)
Comment 8 Martin Flöser 2012-10-06 08:27:40 UTC
Created attachment 74372 [details]
Proposed patch

Please test this patch. I have tested it only with GLES available, so I need the feedback for the other case :-)
Comment 9 Jekyll Wu 2012-10-06 10:17:48 UTC
I can build kwin fine with or without GLES support after applying that patch.
Comment 10 Martin Flöser 2012-10-06 11:45:42 UTC
Git commit 2c1c858de6c58f7561517fe30a78c1e1c7fcec21 by Martin Gräßlin.
Committed on 06/10/2012 at 13:44.
Pushed by graesslin into branch 'master'.

Fix build error when GLES is not available

Note to me: always rebuild with all possible build options if something
is changed.

Sorry for the inconvenience and thanks to the early report of the issue.
FIXED-IN: 4.10

M  +7    -2    kwin/libkwineffects/kwinglutils_funcs.h

http://commits.kde.org/kde-workspace/2c1c858de6c58f7561517fe30a78c1e1c7fcec21