From 76897659f8f4897acbeec8c5a575965c44ef6e0d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 30 Aug 2019 10:38:38 +0200 Subject: Fix FindEGL on Emscripten MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../extra-cmake-modules/find-modules/FindEGL.cmake | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'cmake/3rdparty') diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake index de271a1140..48e5172877 100644 --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake @@ -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) -- cgit v1.2.3