Skip to content

Commit

Permalink
Feature/fix unknown arch triplet (conan-io#2845)
Browse files Browse the repository at this point in the history
* try to fix unknown arch GNU triplet

* raising Exception again

* removed output

* removed None
memsharded authored and lasote committed May 3, 2018
1 parent 751676c commit 1287e6a
Showing 2 changed files with 20 additions and 14 deletions.
14 changes: 10 additions & 4 deletions conans/client/build/autotools_environment.py
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
from conans.client.tools.win import unix_path
from conans.tools import (environment_append, args_to_string, cpu_count, cross_building,
detected_architecture, get_gnu_triplet)
from conans.errors import ConanException


class AutoToolsBuildEnvironment(object):
@@ -76,9 +77,14 @@ def _get_host_build_target_flags(self):
if not cross_building(self._conanfile.settings, os_detected, arch_detected):
return False, False, False

build = get_gnu_triplet(os_detected, arch_detected, compiler)
host = get_gnu_triplet(os_settings, arch_settings, compiler)

try:
build = get_gnu_triplet(os_detected, arch_detected, compiler)
except ConanException:
build = None
try:
host = get_gnu_triplet(os_settings, arch_settings, compiler)
except ConanException:
host = None
return build, host, None

def configure(self, configure_dir=None, args=None, build=None, host=None, target=None,
@@ -190,7 +196,7 @@ def _configure_flags(self):
if arch_flag:
ret.append(arch_flag)
btfs = build_type_flags(compiler=self._compiler, build_type=self._build_type,
vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
if btfs:
ret.extend(btfs)
srf = sysroot_flag(self._deps_cpp_info.sysroot, win_bash=self._win_bash,
20 changes: 10 additions & 10 deletions conans/client/tools/oss.py
Original file line number Diff line number Diff line change
@@ -322,17 +322,17 @@ def get_gnu_triplet(os, arch, compiler=None):

# Calculate the arch
machine = {"x86": "i686" if os != "Linux" else "x86",
"x86_64": "x86_64",
"armv6": "arm",
"armv7": "arm",
"armv7s": "arm",
"armv7k": "arm",
"armv7hf": "arm",
"armv8": "aarch64"}.get(arch, None)
"x86_64": "x86_64",
"armv6": "arm",
"armv7": "arm",
"armv7s": "arm",
"armv7k": "arm",
"armv7hf": "arm",
"armv8": "aarch64"}.get(arch, None)
if machine is None:
raise ConanException("Unknown '%s' machine. Conan doesn't know how to "
"translate it to the GNU triplet, please report at "
"https://github.com/conan-io/conan/issues" % arch)
raise ConanException("Unknown '%s' machine, Conan doesn't know how to "
"translate it to the GNU triplet, please report at "
" https://github.com/conan-io/conan/issues" % arch)

# Calculate the OS
if compiler == "gcc":

0 comments on commit 1287e6a

Please sign in to comment.