diff --git a/recipes/raylib/all/conanfile.py b/recipes/raylib/all/conanfile.py index 38b018aee6008..b265485cd67a2 100644 --- a/recipes/raylib/all/conanfile.py +++ b/recipes/raylib/all/conanfile.py @@ -22,11 +22,21 @@ class RaylibConan(ConanFile): "shared": [True, False], "fPIC": [True, False], "opengl_version": [None, "4.3", "3.3", "2.1", "1.1", "ES-2.0"], + + "customize_build": [True, False], + "module_raudio": [True, False], + "events_waiting": [True, False], + "custom_frame_control": [True, False] } default_options = { "shared": False, "fPIC": True, "opengl_version": None, + + "customize_build": False, + "module_raudio": True, + "events_waiting": False, + "custom_frame_control": False } def export_sources(self): @@ -44,6 +54,11 @@ def configure(self): self.settings.rm_safe("compiler.cppstd") self.settings.rm_safe("compiler.libcxx") + if not self.options.customize_build: + del self.options.module_raudio + del self.options.events_waiting + del self.options.custom_frame_control + def layout(self): cmake_layout(self, src_folder="src") @@ -72,14 +87,28 @@ def generate(self): tc.variables["USE_EXTERNAL_GLFW"] = "ON" tc.variables["OPENGL_VERSION"] = "OFF" if not self.options.opengl_version else self.options.opengl_version tc.variables["WITH_PIC"] = self.options.get_safe("fPIC", True) + + tc.variables["CUSTOMIZE_BUILD"] = self.options.customize_build + if self.options.customize_build: + tc.variables["SUPPORT_MODULE_RAUDIO"] = self.options.get_safe("module_raudio") + tc.variables["SUPPORT_EVENTS_WAITING"] = self.options.get_safe("events_waiting") + tc.variables["SUPPORT_CUSTOM_FRAME_CONTROL"] = self.options.get_safe("custom_frame_control") + + # this makes it include the headers rcamera.h, rgesture.h and rprand.h + tc.variables["SUPPORT_CAMERA_SYSTEM"] = "ON" + tc.variables["SUPPORT_GESTURES_SYSTEM"] = "ON" + tc.variables["SUPPORT_RPRAND_GENERATOR"] = "ON" + # Due to a specific logic of cmakedeps_macros.cmake used by CMakeDeps to try to locate shared libs on Windows tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0054"] = "NEW" + tc.generate() deps = CMakeDeps(self) deps.generate() def build(self): apply_conandata_patches(self) + cmake = CMake(self) cmake.configure() cmake.build()