Skip to content

Commit

Permalink
Fix FindEGL on Emscripten
Browse files Browse the repository at this point in the history
Fixes were upstreamed with commit
3b0bf71a72789eb2b79310b4f67602115e347f56 in extra-cmake-modules and this
brings the file in sync.

Change-Id: Ica3a29fd091afa669f29a3e9775e637566f1cb97
Reviewed-by: Mårten Nordheim <[email protected]>
tronical committed Sep 24, 2019
1 parent 0bcd50b commit 7689765
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake
Original file line number Diff line number Diff line change
@@ -129,25 +129,33 @@ int main(int argc, char *argv[]) {

cmake_pop_check_state()

set(required_vars EGL_INCLUDE_DIR HAVE_EGL)
if(NOT EMSCRIPTEN)
list(APPEND required_vars EGL_LIBRARY)
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(EGL
FOUND_VAR
EGL_FOUND
REQUIRED_VARS
EGL_LIBRARY
EGL_INCLUDE_DIR
HAVE_EGL
${required_vars}
VERSION_VAR
EGL_VERSION
)

if(EGL_FOUND AND NOT TARGET EGL::EGL)
add_library(EGL::EGL UNKNOWN IMPORTED)
set_target_properties(EGL::EGL PROPERTIES
IMPORTED_LOCATION "${EGL_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}"
)
if (EMSCRIPTEN)
add_library(EGL::EGL INTERFACE IMPORTED)
# Nothing further to be done, system include paths have headers and linkage is implicit.
else()
add_library(EGL::EGL UNKNOWN IMPORTED)
set_target_properties(EGL::EGL PROPERTIES
IMPORTED_LOCATION "${EGL_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}"
)
endif()
endif()

mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR HAVE_EGL)

0 comments on commit 7689765

Please sign in to comment.