Title: [186460] releases/WebKitGTK/webkit-2.8
Revision
186460
Author
[email protected]
Date
2015-07-07 06:32:12 -0700 (Tue, 07 Jul 2015)

Log Message

Merge r184954 - [CMake] Improve detection and usage of GL/GLES/EGL libraries.
https://bugs.webkit.org/show_bug.cgi?id=145408

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindEGL.cmake: Improve detection of EGL libraries.
* Source/cmake/FindGLES.cmake: Removed. It was used by the EGL port.
Remove it and make the EGL port use the improved FindOpenGLES2.cmake
instead.
* Source/cmake/FindOpenGL.cmake: Added. Add module to detect OpenGL
libraries. Detect also GLX libraries.
* Source/cmake/FindOpenGLES2.cmake: Improve detection of OpenGLES-v2
libraries. Use find_path() to get the include path.
* Source/cmake/OptionsEfl.cmake: Use now the improved FindOpenGLES2
module.
* Source/cmake/OptionsGTK.cmake: Set default value for ENABLE_GLES2
depending on the libraries found on the system.
Move the detection of GLX (and the include of CMakePushCheckState)
to FindOpenGL.cmake.
Ensure that we only define USE_GLX when we build with OpenGL
(but not with GLESv2).

Source/WebCore:

No new tests, no behavior changes.

* CMakeLists.txt: Ensure that we include the libraries and includes
for the GL/GLESv2/EGL libraries before including the ANGLE directories.
Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
* PlatformEfl.cmake: Remove some includes that are now unneeded,
because we are including now the EGL libraries on CMakeLists.txt
* PlatformGTK.cmake: Remove unneeded include (We are including the EGL
libraries now on CMakeLists.txt)

Modified Paths

Added Paths

Removed Paths

Diff

Modified: releases/WebKitGTK/webkit-2.8/ChangeLog (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/ChangeLog	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/ChangeLog	2015-07-07 13:32:12 UTC (rev 186460)
@@ -1,3 +1,27 @@
+2015-05-28  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [CMake] Improve detection and usage of GL/GLES/EGL libraries.
+        https://bugs.webkit.org/show_bug.cgi?id=145408
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/FindEGL.cmake: Improve detection of EGL libraries.
+        * Source/cmake/FindGLES.cmake: Removed. It was used by the EGL port.
+        Remove it and make the EGL port use the improved FindOpenGLES2.cmake
+        instead.
+        * Source/cmake/FindOpenGL.cmake: Added. Add module to detect OpenGL
+        libraries. Detect also GLX libraries.
+        * Source/cmake/FindOpenGLES2.cmake: Improve detection of OpenGLES-v2
+        libraries. Use find_path() to get the include path.
+        * Source/cmake/OptionsEfl.cmake: Use now the improved FindOpenGLES2
+        module.
+        * Source/cmake/OptionsGTK.cmake: Set default value for ENABLE_GLES2
+        depending on the libraries found on the system.
+        Move the detection of GLX (and the include of CMakePushCheckState)
+        to FindOpenGL.cmake.
+        Ensure that we only define USE_GLX when we build with OpenGL
+        (but not with GLESv2).
+
 2015-05-15  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.8.3 release.

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/CMakeLists.txt (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/CMakeLists.txt	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/CMakeLists.txt	2015-07-07 13:32:12 UTC (rev 186460)
@@ -2954,20 +2954,32 @@
     # these include directories need to be added before the ANGLE directories.
     if (OPENGL_FOUND)
         list(APPEND WebCore_INCLUDE_DIRECTORIES
-            ${OPENGL_INCLUDE_DIR}
+            ${OPENGL_INCLUDE_DIRS}
         )
         list(APPEND WebCore_LIBRARIES
-            ${OPENGL_gl_LIBRARY}
+            ${OPENGL_LIBRARIES}
         )
+        add_definitions(${OPENGL_DEFINITIONS})
     elseif (OPENGLES2_FOUND)
         list(APPEND WebCore_INCLUDE_DIRECTORIES
-            ${OPENGLES2_INCLUDE_DIR}
+            ${OPENGLES2_INCLUDE_DIRS}
         )
         list(APPEND WebCore_LIBRARIES
             ${OPENGLES2_LIBRARIES}
         )
+        add_definitions(${OPENGLES2_DEFINITIONS})
     endif ()
 
+    if (EGL_FOUND)
+        list(APPEND WebCore_INCLUDE_DIRECTORIES
+            ${EGL_INCLUDE_DIRS}
+        )
+        list(APPEND WebCore_LIBRARIES
+            ${EGL_LIBRARIES}
+        )
+        add_definitions(${EGL_DEFINITIONS})
+    endif ()
+
     list(APPEND WebCore_INCLUDE_DIRECTORIES
         "${THIRDPARTY_DIR}/ANGLE/"
         "${THIRDPARTY_DIR}/ANGLE/include/KHR"

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog	2015-07-07 13:32:12 UTC (rev 186460)
@@ -1,3 +1,20 @@
+2015-05-28  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [CMake] Improve detection and usage of GL/GLES/EGL libraries.
+        https://bugs.webkit.org/show_bug.cgi?id=145408
+
+        Reviewed by Carlos Garcia Campos.
+
+        No new tests, no behavior changes.
+
+        * CMakeLists.txt: Ensure that we include the libraries and includes
+        for the GL/GLESv2/EGL libraries before including the ANGLE directories.
+        Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
+        * PlatformEfl.cmake: Remove some includes that are now unneeded,
+        because we are including now the EGL libraries on CMakeLists.txt
+        * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
+        libraries now on CMakeLists.txt)
+
 2015-05-07  Philip Chimento  <[email protected]>
 
         [GTK] DrawingBuffer.h used outside of include guard

Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/PlatformGTK.cmake (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/WebCore/PlatformGTK.cmake	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/PlatformGTK.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -394,12 +394,6 @@
     )
 endif ()
 
-if (WTF_USE_EGL)
-    list(APPEND WebCore_LIBRARIES
-        ${EGL_LIBRARY}
-    )
-endif ()
-
 if (WTF_USE_OPENGL_ES_2)
     list(APPEND WebCore_SOURCES
         platform/graphics/opengl/Extensions3DOpenGLES.cpp

Modified: releases/WebKitGTK/webkit-2.8/Source/cmake/FindEGL.cmake (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/cmake/FindEGL.cmake	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/cmake/FindEGL.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -2,8 +2,9 @@
 # Once done, this will define
 #
 #  EGL_FOUND - system has EGL installed.
-#  EGL_INCLUDE_DIR - directories which contain the EGL headers.
-#  EGL_LIBRARY - libraries required to link against EGL.
+#  EGL_INCLUDE_DIRS - directories which contain the EGL headers.
+#  EGL_LIBRARIES - libraries required to link against EGL.
+#  EGL_DEFINITIONS - Compiler switches required for using EGL.
 #
 # Copyright (C) 2012 Intel Corporation. All rights reserved.
 #
@@ -28,12 +29,25 @@
 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h)
 
+find_package(PkgConfig)
+
+pkg_check_modules(PC_EGL egl)
+
+if (PC_EGL_FOUND)
+    set(EGL_DEFINITIONS ${PC_EGL_CFLAGS_OTHER})
+endif ()
+
+find_path(EGL_INCLUDE_DIRS NAMES EGL/egl.h
+    HINTS ${PC_EGL_INCLUDEDIR} ${PC_EGL_INCLUDE_DIRS}
+)
+
 set(EGL_NAMES ${EGL_NAMES} egl EGL)
-find_library(EGL_LIBRARY NAMES ${EGL_NAMES})
+find_library(EGL_LIBRARIES NAMES ${EGL_NAMES}
+    HINTS ${PC_EGL_LIBDIR} ${PC_EGL_LIBRARY_DIRS}
+)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIRS EGL_LIBRARIES)
 
-mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY)
+mark_as_advanced(EGL_INCLUDE_DIRS EGL_LIBRARIES)

Deleted: releases/WebKitGTK/webkit-2.8/Source/cmake/FindGLES.cmake (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/cmake/FindGLES.cmake	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/cmake/FindGLES.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -1,38 +0,0 @@
-# - Try to find OpenGLES
-# Once done this will define
-#  
-#  OPENGLES2_FOUND        - system has OpenGLESv2 installed.
-#  OPENGLES2_INCLUDE_DIR  - directories which contain the OpenGlEsv2 headers.
-#  OPENGLES2_LIBRARIES    - libraries required to link against OpenGLESv2
-#
-# Copyright (C) 2012 Intel Corporation. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
-# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-find_path(OPENGLES2_INCLUDE_DIR NAMES GLES2/gl2.h)
-
-find_library(OPENGLES2_LIBRARY NAMES GLESv2)
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 DEFAULT_MSG OPENGLES2_INCLUDE_DIR OPENGLES2_LIBRARY)
-
-mark_as_advanced(OPENGLES2_INCLUDE_DIR OPENGLES2_LIBRARY)

Copied: releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGL.cmake (from rev 186459, releases/WebKitGTK/webkit-2.8/Source/cmake/FindEGL.cmake) (0 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGL.cmake	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGL.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -0,0 +1,64 @@
+# - Try to Find OpenGL
+# Once done, this will define
+#
+#  OPENGL_FOUND - system has OpenGL installed.
+#  OPENGL_INCLUDE_DIRS - directories which contain the OpenGL headers.
+#  OPENGL_LIBRARIES - libraries required to link against OpenGL.
+#  OPENGL_DEFINITIONS - Compiler switches required for using OpenGL.
+#
+# Copyright (C) 2015 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+find_package(PkgConfig)
+
+pkg_check_modules(PC_OPENGL gl)
+
+if (PC_OPENGL_FOUND)
+    set(OPENGL_DEFINITIONS ${PC_OPENGL_CFLAGS_OTHER})
+endif ()
+
+find_path(OPENGL_INCLUDE_DIRS NAMES GL/gl.h
+    HINTS ${PC_OPENGL_INCLUDEDIR} ${PC_OPENGL_INCLUDE_DIRS}
+)
+
+set(OPENGL_NAMES ${OPENGL_NAMES} gl GL)
+find_library(OPENGL_LIBRARIES NAMES ${OPENGL_NAMES}
+    HINTS ${PC_OPENGL_LIBDIR} ${PC_OPENGL_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGL DEFAULT_MSG OPENGL_INCLUDE_DIRS OPENGL_LIBRARIES)
+
+mark_as_advanced(OPENGL_INCLUDE_DIRS OPENGL_LIBRARIES)
+
+if (OPENGL_FOUND)
+    # We don't use find_package for GLX because it is part of -lGL, unlike EGL. We need to
+    # have OPENGL_INCLUDE_DIRS as part of the directories check_include_files() looks for in
+    # case OpenGL is installed into a non-standard location.
+    include(CMakePushCheckState)
+    CMAKE_PUSH_CHECK_STATE()
+    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIRS})
+    check_include_files("GL/glx.h" GLX_FOUND)
+    CMAKE_POP_CHECK_STATE()
+endif ()

Modified: releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGLES2.cmake (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGLES2.cmake	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/cmake/FindOpenGLES2.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -9,17 +9,19 @@
 pkg_check_modules(PC_OPENGLES2 glesv2)
 
 if (PC_OPENGLES2_FOUND)
-    set(OPENGLES2_INCLUDE_DIRS ${PC_OPENGLES2_INCLUDE_DIRS})
     set(OPENGLES2_DEFINITIONS ${PC_OPENGLES2_CFLAGS_OTHER})
-else ()
-    find_path(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h)
 endif ()
 
-find_library(OPENGLES2_LIBRARIES GLESv2
-    HINTS ${PC_OPENGLES2_LIBRARY_DIRS} ${PC_OPENGLES2_LIBDIR}
+find_path(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h
+    HINTS ${PC_OPENGLES2_INCLUDEDIR} ${PC_OPENGLES2_INCLUDE_DIRS}
 )
 
+set(OPENGLES2_NAMES ${OPENGLES2_NAMES} glesv2 GLESv2)
+find_library(OPENGLES2_LIBRARIES NAMES ${OPENGLES2_NAMES}
+    HINTS ${PC_OPENGLES2_LIBDIR} ${PC_OPENGLES2_LIBRARY_DIRS}
+)
+
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIRS)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENGLES2 DEFAULT_MSG OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARIES)
 
-mark_as_advanced(OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARY)
+mark_as_advanced(OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARIES)

Modified: releases/WebKitGTK/webkit-2.8/Source/cmake/OptionsGTK.cmake (186459 => 186460)


--- releases/WebKitGTK/webkit-2.8/Source/cmake/OptionsGTK.cmake	2015-07-07 12:40:36 UTC (rev 186459)
+++ releases/WebKitGTK/webkit-2.8/Source/cmake/OptionsGTK.cmake	2015-07-07 13:32:12 UTC (rev 186460)
@@ -335,7 +335,7 @@
     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
     set(CMAKE_REQUIRED_INCLUDES ${REQUIRED_INCLUDES_OLD})
 
-    if (GLX_FOUND)
+    if (GLX_FOUND AND NOT ENABLE_GLES2)
         set(WTF_USE_GLX 1)
     endif ()
 endif ()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to