From b4dfa3727a0171346200bf7ea621a63d1c57dac0 Mon Sep 17 00:00:00 2001 From: Chris Collins Date: Fri, 5 Jan 2024 15:57:31 +1100 Subject: [PATCH] wayland: fix cross-building tests to use correct method * Fix #22166: switch from using cross_building to using can_run so the conf option that explicitly says we must (or must not) cross build is respected correctly. --- recipes/wayland/all/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/wayland/all/conanfile.py b/recipes/wayland/all/conanfile.py index f863770107024..7694702f24251 100644 --- a/recipes/wayland/all/conanfile.py +++ b/recipes/wayland/all/conanfile.py @@ -1,6 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.build import cross_building +from conan.tools.build import can_run from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import copy, get, replace_in_file, rmdir from conan.tools.gnu import PkgConfigDeps @@ -61,7 +61,7 @@ def build_requirements(self): self.tool_requires("meson/1.3.0") if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): self.tool_requires("pkgconf/2.1.0") - if cross_building(self): + if not can_run(self): self.tool_requires(str(self.ref)) def source(self): @@ -70,12 +70,12 @@ def source(self): def generate(self): env = VirtualBuildEnv(self) env.generate() - if not cross_building(self): + if can_run(self): env = VirtualRunEnv(self) env.generate(scope="build") pkg_config_deps = PkgConfigDeps(self) - if cross_building(self): + if not can_run(self): pkg_config_deps.build_context_activated = ["wayland"] elif self.dependencies["expat"].is_build_context: # wayland is being built as build_require # If wayland is the build_require, all its dependencies are treated as build_requires @@ -87,7 +87,7 @@ def generate(self): tc.project_options["libraries"] = self.options.enable_libraries tc.project_options["dtd_validation"] = self.options.enable_dtd_validation tc.project_options["documentation"] = False - if cross_building(self): + if not can_run(self): tc.project_options["build.pkg_config_path"] = self.generators_folder if Version(self.version) >= "1.18.91": tc.project_options["scanner"] = True