From 88e7e801e9c7c1155a01b66e5a8f63914e1cb4a8 Mon Sep 17 00:00:00 2001 From: jgsogo Date: Sat, 25 Sep 2021 21:41:23 +0200 Subject: [PATCH] sdl2 is provided by emscripten itself --- recipes/magnum/all/conanfile.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/recipes/magnum/all/conanfile.py b/recipes/magnum/all/conanfile.py index e63f66602b09f..233c0efdc6dad 100644 --- a/recipes/magnum/all/conanfile.py +++ b/recipes/magnum/all/conanfile.py @@ -3,6 +3,7 @@ import os import re import textwrap +import shutil required_conan_version = ">=1.33.0" @@ -192,9 +193,9 @@ def config_options(self): if self.settings.os == "Emscripten": self.options.shared_plugins = False - self.options.target_gl = "desktop_gl" # FIXME: Should be gles2? + self.options.target_gl = "gles2" - self.options.sdl2_application = False # FIXME: Fails to build (because of target_gl value? Needs emscripten-port?) + self.options.sdl2_application = True # FIXME: Fails to build. Use emscripten-port?) self.options.gl_info = False @@ -276,7 +277,7 @@ def requirements(self): if self.options.glfw_application: self.requires("glfw/3.3.4") - if self.options.sdl2_application: + if self.options.sdl2_application and self.settings.os != "Emscripten": self.requires("sdl/2.0.16") def build_requirements(self): @@ -433,6 +434,12 @@ def _patch_sources(self): "EGL::EGL", "egl::egl") + # Copy FindOpenGLES2/3.cmake to build folder + shutil.copy(os.path.join(self._source_subfolder, "modules", "FindOpenGLES2.cmake"), "FindOpenGLES2.cmake") + shutil.copy(os.path.join(self._source_subfolder, "modules", "FindOpenGLES3.cmake"), "FindOpenGLES3.cmake") + if self.settings.os == "Emscripten": + shutil.copy(os.path.join(self._source_subfolder, "modules", "FindSDL2.cmake"), "FindSDL2.cmake") + def build(self): self._patch_sources() @@ -611,7 +618,9 @@ def package_info(self): self.cpp_info.components["sdl2_application"].names["cmake_find_package"] = "Sdl2Application" self.cpp_info.components["sdl2_application"].names["cmake_find_package_multi"] = "Sdl2Application" self.cpp_info.components["sdl2_application"].libs = ["MagnumSdl2Application{}".format(lib_suffix)] - self.cpp_info.components["sdl2_application"].requires = ["magnum_main", "sdl::sdl"] + self.cpp_info.components["sdl2_application"].requires = ["magnum_main"] + if self.settings.os != "Emscripten": + self.cpp_info.components["sdl2_application"].requires += ["sdl::sdl"] if self.options.target_gl: self.cpp_info.components["sdl2_application"].requires += ["gl"]