Skip to content

Commit 64cf14a

Browse files
author
Carsten Hartenfels
committed
Fix FindEGL compile check when using Emscripten
Under Emscripten, EGL does not require any libraries to be linked in. The FindEGL module already has a partial concession of this since 3b0bf71, but it still searches for the library and, crucially, tries to link it when performing the compile check if found. If the system you're on has a libEGL.so installed, this will end up trying to link that into the build, which will obviously fail because you can't like a native shared object into a WebAssembly build. This commit removes the library part entirely under Emscripten, making the find module no longer go searching for it pointlessly and not attempt to link anything when performing the compile check.
1 parent e5682c5 commit 64cf14a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

find-modules/FindEGL.cmake

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ find_path(EGL_INCLUDE_DIR
5757
HINTS
5858
${PKG_EGL_INCLUDE_DIRS}
5959
)
60-
find_library(EGL_LIBRARY
61-
NAMES
62-
EGL
63-
libEGL
64-
HINTS
65-
${PKG_EGL_LIBRARY_DIRS}
66-
)
60+
if(NOT EMSCRIPTEN)
61+
find_library(EGL_LIBRARY
62+
NAMES
63+
EGL
64+
libEGL
65+
HINTS
66+
${PKG_EGL_LIBRARY_DIRS}
67+
)
68+
endif()
6769

6870
# NB: We do *not* use the version information from pkg-config, as that
6971
# is the implementation version (eg: the Mesa version)
@@ -95,7 +97,9 @@ if(EGL_INCLUDE_DIR)
9597
endif()
9698

9799
cmake_push_check_state(RESET)
98-
list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
100+
if(NOT EMSCRIPTEN)
101+
list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}")
102+
endif()
99103
list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}")
100104

101105
check_cxx_source_compiles("

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy