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

Add missing tools to develop #10536

Merged
merged 3 commits into from Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions conan/tools/__init__.py
@@ -1,2 +1,4 @@
from conans.model.version import Version

CONAN_TOOLCHAIN_ARGS_FILE = "conanbuild.conf"
CONAN_TOOLCHAIN_ARGS_SECTION = "toolchain"
1 change: 1 addition & 0 deletions conan/tools/build/__init__.py
@@ -1 +1,2 @@
from conan.tools.build.cpu import build_jobs
from conan.tools.build.cross_building import cross_building
20 changes: 20 additions & 0 deletions conan/tools/build/cross_building.py
@@ -0,0 +1,20 @@

def cross_building(conanfile=None, skip_x64_x86=False):
host_os = conanfile.settings.get_safe("os")
host_arch = conanfile.settings.get_safe("arch")
build_os = conanfile.settings_build.get_safe('os')
build_arch = conanfile.settings_build.get_safe('arch')

if skip_x64_x86 and host_os is not None and (build_os == host_os) and \
host_arch is not None and ((build_arch == "x86_64") and (host_arch == "x86") or
(build_arch == "sparcv9") and (host_arch == "sparc") or
(build_arch == "ppc64") and (host_arch == "ppc32")):
return False

if host_os is not None and (build_os != host_os):
return True
if host_arch is not None and (build_arch != host_arch):
return True

return False