Skip to content

Commit

Permalink
Add missing tools to develop (#10536)
Browse files Browse the repository at this point in the history
* add Version

* add more tools

* remove not needed
  • Loading branch information
czoido committed Feb 8, 2022
1 parent 65082c3 commit f930e50
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
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

0 comments on commit f930e50

Please sign in to comment.