Diff
Modified: trunk/ChangeLog (184953 => 184954)
--- trunk/ChangeLog 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/ChangeLog 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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-27 Dean Jackson <[email protected]>
img.currentSrc problem in strict mode with old picturefill
Modified: trunk/Source/WebCore/CMakeLists.txt (184953 => 184954)
--- trunk/Source/WebCore/CMakeLists.txt 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/WebCore/CMakeLists.txt 2015-05-28 11:30:52 UTC (rev 184954)
@@ -3000,24 +3000,37 @@
endif ()
if (ENABLE_GRAPHICS_CONTEXT_3D)
- # For platforms that want to use system-provided OpenGL (ES) headers,
- # these include directories need to be added before the ANGLE directories.
- if (OPENGL_FOUND)
+ # For platforms that want to use system-provided OpenGL (ES) / EGL headers,
+ # these include directories, libraries or definitions need to be
+ # added before the ANGLE directories.
+ if (USE_OPENGL)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
- ${OPENGL_INCLUDE_DIR}
+ ${OPENGL_INCLUDE_DIRS}
)
list(APPEND WebCore_LIBRARIES
- ${OPENGL_gl_LIBRARY}
+ ${OPENGL_LIBRARIES}
)
- elseif (OPENGLES2_FOUND)
+ add_definitions(${OPENGL_DEFINITIONS})
+ elseif (USE_OPENGL_ES_2)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
- ${OPENGLES2_INCLUDE_DIR}
+ ${OPENGLES2_INCLUDE_DIRS}
)
list(APPEND WebCore_LIBRARIES
${OPENGLES2_LIBRARIES}
)
+ add_definitions(${OPENGLES2_DEFINITIONS})
endif ()
+ if (USE_EGL)
+ list(APPEND WebCore_SYSTEM_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: trunk/Source/WebCore/ChangeLog (184953 => 184954)
--- trunk/Source/WebCore/ChangeLog 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/WebCore/ChangeLog 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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-28 Youenn Fablet <[email protected]>
Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
Modified: trunk/Source/WebCore/PlatformEfl.cmake (184953 => 184954)
--- trunk/Source/WebCore/PlatformEfl.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/WebCore/PlatformEfl.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -393,7 +393,6 @@
if (USE_EGL)
list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
- ${EGL_INCLUDE_DIR}
"${WEBCORE_DIR}/platform/graphics/surfaces/egl"
)
endif ()
@@ -427,12 +426,8 @@
)
endif ()
-if (USE_EGL)
+if (NOT USE_EGL AND X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
list(APPEND WebCore_LIBRARIES
- ${EGL_LIBRARY}
- )
-elseif (X11_Xcomposite_FOUND AND X11_Xrender_FOUND)
- list(APPEND WebCore_LIBRARIES
${X11_Xcomposite_LIB}
${X11_Xrender_LIB}
)
Modified: trunk/Source/WebCore/PlatformGTK.cmake (184953 => 184954)
--- trunk/Source/WebCore/PlatformGTK.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/WebCore/PlatformGTK.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -419,11 +419,6 @@
)
endif ()
-if (USE_EGL)
- list(APPEND WebCore_LIBRARIES
- ${EGL_LIBRARY}
- )
-endif ()
if (USE_OPENGL_ES_2)
list(APPEND WebCore_SOURCES
Modified: trunk/Source/cmake/FindEGL.cmake (184953 => 184954)
--- trunk/Source/cmake/FindEGL.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/cmake/FindEGL.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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: trunk/Source/cmake/FindGLES.cmake (184953 => 184954)
--- trunk/Source/cmake/FindGLES.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/cmake/FindGLES.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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: trunk/Source/cmake/FindOpenGL.cmake (from rev 184953, trunk/Source/cmake/FindEGL.cmake) (0 => 184954)
--- trunk/Source/cmake/FindOpenGL.cmake (rev 0)
+++ trunk/Source/cmake/FindOpenGL.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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: trunk/Source/cmake/FindOpenGLES2.cmake (184953 => 184954)
--- trunk/Source/cmake/FindOpenGLES2.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/cmake/FindOpenGLES2.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -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: trunk/Source/cmake/OptionsEfl.cmake (184953 => 184954)
--- trunk/Source/cmake/OptionsEfl.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/cmake/OptionsEfl.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -230,7 +230,7 @@
option(ENABLE_GLES2 "Enable GLES Support")
if (ENABLE_GLES2)
- find_package(GLES REQUIRED)
+ find_package(OpenGLES2 REQUIRED)
set(USE_OPENGL_ES_2 1)
add_definitions(-DUSE_OPENGL_ES_2=1)
else ()
Modified: trunk/Source/cmake/OptionsGTK.cmake (184953 => 184954)
--- trunk/Source/cmake/OptionsGTK.cmake 2015-05-28 10:12:46 UTC (rev 184953)
+++ trunk/Source/cmake/OptionsGTK.cmake 2015-05-28 11:30:52 UTC (rev 184954)
@@ -1,4 +1,3 @@
-include(CMakePushCheckState)
include(GNUInstallDirs)
set(PROJECT_VERSION_MAJOR 2)
@@ -49,10 +48,22 @@
find_package(ATSPI 2.5.3)
find_package(EGL)
find_package(OpenGL)
+find_package(OpenGLES2)
WEBKIT_OPTION_BEGIN()
-WEBKIT_OPTION_DEFINE(ENABLE_GLES2 "Whether to enable OpenGL ES 2.0." PUBLIC OFF)
+# Set the default value for ENABLE_GLES2 automatically.
+# We are not enabling or disabling automatically a feature here, because
+# the feature is by default always on (ENABLE_OPENGL=ON).
+# What we select here automatically is if we use OPENGL (ENABLE_GLES2=OFF)
+# or OPENGLES2 (ENABLE_GLES2=ON) for building the feature.
+set(ENABLE_GLES2_DEFAULT OFF)
+
+if (NOT OPENGL_FOUND AND OPENGLES2_FOUND)
+ set(ENABLE_GLES2_DEFAULT ON)
+endif ()
+
+WEBKIT_OPTION_DEFINE(ENABLE_GLES2 "Whether to enable OpenGL ES 2.0." PUBLIC ${ENABLE_GLES2_DEFAULT})
WEBKIT_OPTION_DEFINE(ENABLE_GTKDOC "Whether or not to use generate gtkdoc." PUBLIC OFF)
WEBKIT_OPTION_DEFINE(ENABLE_INTROSPECTION "Whether to enable GObject introspection." PUBLIC ON)
WEBKIT_OPTION_DEFINE(ENABLE_OPENGL "Whether to use OpenGL." PUBLIC ON)
@@ -102,14 +113,6 @@
endif ()
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_DIR as part of the directories check_include_files() looks for in
- # case OpenGL is installed into a non-standard location.
- CMAKE_PUSH_CHECK_STATE()
- set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
- check_include_files("GL/glx.h" GLX_FOUND)
- CMAKE_POP_CHECK_STATE()
-
if (GLX_FOUND)
list(APPEND CAIROGL_COMPONENTS cairo-glx)
endif ()
@@ -323,7 +326,7 @@
SET_AND_EXPOSE_TO_BUILD(USE_EGL ${EGL_FOUND})
- if (ENABLE_X11_TARGET AND GLX_FOUND)
+ if (ENABLE_X11_TARGET AND GLX_FOUND AND USE_OPENGL)
SET_AND_EXPOSE_TO_BUILD(USE_GLX TRUE)
endif ()