Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wayland: fix cross-building tests to use correct method #22167

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions recipes/wayland/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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
Expand Down