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

[boost] allow to build for unknown architectures (e.g. e2k) #569

Merged
merged 3 commits into from
Jan 9, 2020
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
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,
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
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