Skip to content

Commit

Permalink
Merge pull request #569 from bincrafters/boost_allow_unknown_arch
Browse files Browse the repository at this point in the history
[boost] allow to build for unknown architectures (e.g. e2k)
  • Loading branch information
danimtb authored Jan 9, 2020
2 parents 9bdec3a + 1ac6417 commit 55c9b63
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from conans import ConanFile
from conans import tools
from conans.client.build.cppstd_flags import cppstd_flag
from conans.model.version import Version
from conans.tools import Version
from conans.errors import ConanException

from conans.errors import ConanInvalidConfiguration
import os
import sys
import shutil
Expand Down Expand Up @@ -56,29 +57,32 @@ class BoostConan(ConanFile):
}
options.update({"without_%s" % libname: [True, False] for libname in lib_list})

default_options = ["shared=False",
"header_only=False",
"error_code_header_only=False",
"system_no_deprecated=False",
"asio_no_deprecated=False",
"filesystem_no_deprecated=False",
"fPIC=True",
"layout=system",
"magic_autolink=False",
"python_executable=None",
"python_version=None",
"namespace=boost",
"namespace_alias=False",
"zlib=True",
"bzip2=True",
"lzma=False",
"zstd=False",
"segmented_stacks=False",
"extra_b2_flags=None"]

default_options.extend(["without_%s=False" % libname for libname in lib_list if libname != "python"])
default_options.append("without_python=True")
default_options = tuple(default_options)
default_options = {
'shared': False,
'header_only': False,
'error_code_header_only': False,
'system_no_deprecated': False,
'asio_no_deprecated': False,
'filesystem_no_deprecated': False,
'fPIC': True,
'layout': 'system',
'magic_autolink': False,
'python_executable': 'None',
'python_version': 'None',
'namespace': 'boost',
'namespace_alias': False,
'zlib': True,
'bzip2': True,
'lzma': False,
'zstd': False,
'segmented_stacks': False,
'extra_b2_flags': 'None',
}

for libname in lib_list:
if libname != "python":
default_options.update({"without_%s" % libname: False})
default_options.update({"without_python": True})
short_paths = True
no_copy_source = True
exports_sources = ['patches/*']
Expand Down Expand Up @@ -210,7 +214,7 @@ def _python_version(self):
"import sys; "
"print('%s.%s' % (sys.version_info[0], sys.version_info[1]))")
if self.options.python_version and version != self.options.python_version:
raise Exception("detected python version %s doesn't match conan option %s" % (version,
raise ConanInvalidConfiguration("detected python version %s doesn't match conan option %s" % (version,
self.options.python_version))
return version

Expand Down Expand Up @@ -304,7 +308,7 @@ def _python_libraries(self):
if os.path.isfile(python_lib):
self.output.info('found python library: %s' % python_lib)
return python_lib.replace('\\', '/')
raise Exception("couldn't locate python libraries - make sure you have installed python development files")
raise ConanInvalidConfiguration("couldn't locate python libraries - make sure you have installed python development files")

def _clean(self):
src = os.path.join(self.source_folder, self._folder_name)
Expand Down Expand Up @@ -621,8 +625,7 @@ def _get_build_cross_flags(self):
elif arch.startswith("mips"):
pass
else:
raise Exception("I'm so sorry! I don't know the appropriate ABI for "
"your architecture. :'(")
self.output.warn("Unable to detect the appropriate ABI for %s architecture." % arch)
self.output.info("Cross building flags: %s" % flags)

return flags
Expand Down

0 comments on commit 55c9b63

Please sign in to comment.