Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r184954 - [CMake] Improve detection and usage of GL/GLES/EGL li…
…braries. 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)
- Loading branch information
1 parent
5103635
commit a810bd4
Showing
9 changed files
with
150 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters