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: add boost/1.75.0 #3872

Merged
merged 22 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ceb1278
boost: add boost/1.75.0
madebr Dec 12, 2020
ec8677b
boost: disable json in test_package by default
madebr Dec 12, 2020
07559df
boost: fix layout suffix on MSVC
madebr Dec 12, 2020
31941f5
boost: fix test_package
madebr Dec 12, 2020
4931e6e
boost: fix fix test_package ;)
madebr Dec 12, 2020
f89b444
boost: json requires c++11 compiler. So don't build on too old compil…
madebr Dec 13, 2020
fce828b
boost: remove unsupported options at end of config_options method
madebr Dec 13, 2020
2d6e2c3
boost: set version default c++ standard=11 for MSVC and apple-clang
madebr Dec 13, 2020
1b527a3
boost: update compiler versions having c++11 default or higher
madebr Dec 13, 2020
c6ac4a2
boost: move dlls+pdbs to bin folder + remove pdbs
madebr Dec 14, 2020
c6e96f8
boost: iOS needs BOOST_(AC|SP)_USE_PTHREADS
madebr Dec 14, 2020
78f3298
boost: I don't know what version of compiler supports c++11 of every …
madebr Dec 13, 2020
7d0b80e
boost: test availability of dependency with correct name
madebr Dec 14, 2020
3384f92
boost: add locale test
madebr Dec 14, 2020
3209e04
boost: pass root path of libiconv and icu
madebr Dec 14, 2020
7b491f6
boost: allow static icu dependency (with boost:i18n_backend=icu)
madebr Dec 15, 2020
7bad3f9
boost: add nowide option + check fiber/newide
madebr Dec 15, 2020
6171fa4
boost: fix typos + refactor utility function + uncomment -q
madebr Dec 19, 2020
3ec9036
booost: re-enable -q + layout=b2-default is equivalent to versioned o…
madebr Dec 16, 2020
ca43764
boost: build only MSVC with nowide
madebr Dec 22, 2020
3303863
boost: add include <ios>
madebr Dec 22, 2020
aaa7a89
boost: re-enable all configurations
madebr Dec 23, 2020
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
6 changes: 6 additions & 0 deletions recipes/boost/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ sources:
"https://sourceforge.net/projects/boost/files/boost/1.74.0/boost_1_74_0.tar.bz2"
]
sha256: "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1"
1.75.0:
url: [
"https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.bz2",
"https://sourceforge.net/projects/boost/files/boost/1.75.0/boost_1_75_0.tar.bz2"
]
sha256: "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb"
patches:
SSE4 marked this conversation as resolved.
Show resolved Hide resolved
1.69.0:
- patch_file: "patches/boost_build_asmflags.patch"
Expand Down
118 changes: 73 additions & 45 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"graph",
"graph_parallel",
"iostreams",
"json",
"locale",
"log",
"math",
Expand Down Expand Up @@ -140,15 +141,20 @@ def _dependencies(self):
raise ConanException("Cannot find {}".format(dependencies_filepath))
return yaml.load(open(dependencies_filepath))

def _iter_modules(self):
tree = {k: v[:] for k, v in self._dependencies["dependencies"].items()}
while tree:
nodeps = set(k for k, v in tree.items() if not v)
if not nodeps:
raise ConanException("cyclic dependency tree detected")
for nodep in nodeps:
yield nodep
tree = {k: [d for d in v if d not in nodeps] for k, v in tree.items() if k not in nodeps}
def _all_dependent_modules(self, name):
dependencies = {name}
new_dependencies = self._dependencies["dependencies"][name]
while True:
len_before = len(dependencies)
dependencies.update(new_dependencies)
len_after = len(dependencies)
if len_before == len_after:
break
next_new_dependencies = set()
for new_dependency in new_dependencies:
next_new_dependencies.update(set(self._dependencies["dependencies"][new_dependency]))
new_dependencies = next_new_dependencies
return dependencies
madebr marked this conversation as resolved.
Show resolved Hide resolved

@property
def _source_subfolder(self):
Expand Down Expand Up @@ -220,6 +226,10 @@ def configure(self):
if self.options.get_safe("without_{}".format(mod_dep), False):
raise ConanInvalidConfiguration("{} requires {}: {} is disabled".format(mod_name, mod_deps, mod_dep))

# FIXME: check this + shouldn't default be on self._is_msvc?
# if self.options.layout == "b2-default":
# self.options.layout = "versioned" if self.settings.os == "Windows" else "system"

if not self.options.without_python:
if not self.options.python_version:
self.options.python_version = self._detect_python_version()
Expand Down Expand Up @@ -584,7 +594,7 @@ def _b2_os(self):

@property
def _b2_address_model(self):
if str(self.settings.arch) in ["x86_64", "ppc64", "ppc64le", "mips64", "armv8", "sparcv9"]:
if self.settings.arch in ("x86_64", "ppc64", "ppc64le", "mips64", "armv8", "armv8.3", "sparcv9"):
return "64"
else:
return "32"
Expand Down Expand Up @@ -663,7 +673,7 @@ def _build_flags(self):
if self._b2_abi:
flags.append("abi=%s" % self._b2_abi)

if self.options.layout is not "b2-default":
if self.options.layout != "b2-default":
flags.append("--layout=%s" % self.options.layout)
flags.append("--user-config=%s" % os.path.join(self._boost_build_dir, 'user-config.jam'))
flags.append("-sNO_ZLIB=%s" % ("0" if self._with_zlib else "1"))
Expand Down Expand Up @@ -999,9 +1009,9 @@ def _create_emscripten_libs(self):
self.run(cmd)

@property
def _is_versioned_layout(self):
layout = self.options.get_safe("layout")
return layout == "versioned" or (layout == "b2-default" and os.name == 'nt')
def _is_versioned_include(self):
layout = self.options.layout
return layout == "versioned" or (layout == "b2-default" and self.settings.os == "Windows")

@staticmethod
def _option_to_conan_requirement(name):
Expand Down Expand Up @@ -1042,7 +1052,7 @@ def package_info(self):
if self.options.error_code_header_only:
self.cpp_info.components["headers"].defines.append("BOOST_ERROR_CODE_HEADER_ONLY")

if self._is_versioned_layout:
if self._is_versioned_include:
version = tools.Version(self.version)
self.cpp_info.components["headers"].includedirs.append(os.path.join("include", "boost-{}_{}".format(version.major, version.minor)))

Expand Down Expand Up @@ -1086,34 +1096,50 @@ def package_info(self):
# A Boost::dynamic_linking cmake target does only make sense for a shared boost package
self.cpp_info.components["dynamic_linking"].defines = ["BOOST_ALL_DYN_LINK"]

libsuffix = ""
if self._is_versioned_layout:
# https://www.boost.org/doc/libs/1_73_0/more/getting_started/windows.html#library-naming
toolset_tag = "-{}".format(self._toolset_tag)
threading_tag = "-mt" if self.options.multithreading else ""
abi_tag = ""
if self._is_msvc:
# FIXME: add 'y' when using cpython cci package and when python is built in debug mode
static_runtime_key = "s" if "MT" in str(self.settings.compiler.runtime) else ""
debug_runtime_key = "g" if "d" in str(self.settings.compiler.runtime) else ""
debug_key = "d" if self.settings.build_type == "Debug" else ""
abi = static_runtime_key + debug_runtime_key + debug_key
if abi:
abi_tag = "-{}".format(abi)
else:
debug_tag = "d" if self.settings.build_type == "Debug" else ""
abi = debug_tag
if abi:
abi_tag = "-{}".format(abi)

arch_tag = "-{}{}".format(self._b2_architecture[0], self._b2_address_model)
version = tools.Version(self.version)
if not version.patch or version.patch == "0":
version_tag = "-{}_{}".format(version.major, version.minor)
else:
version_tag = "-{}_{}_{}".format(version.major, version.minor, version.patch)
libsuffix = toolset_tag + threading_tag + abi_tag + arch_tag + version_tag
self.output.info("Versioning library suffix: {}".format(libsuffix))
# https://www.boost.org/doc/libs/1_73_0/more/getting_started/windows.html#library-naming
# libsuffix for MSVC:
# - system: ""
# - versioned: "-vc142-mt-d-x64-1_74"
# - tagged: "-mt-d-x64"
# - b2-default: same as versioned
libsuffix_lut = {
"system": "",
"versioned": "{toolset}{threading}{abi}{arch}{version}",
"tagged": "{threading}{abi}{arch}",
}
if self._is_msvc:
libsuffix_lut["b2-default"] = libsuffix_lut["versioned"]
else:
libsuffix_lut["b2-default"] = libsuffix_lut["system"]
libsuffix_data = {
"toolset": "-{}".format(self._toolset_tag),
"threading": "-mt" if self.options.multithreading else "",
"abi": "",
"ach": "",
"version": "",
}
if self._is_msvc: # FIXME: mingw?
# FIXME: add 'y' when using cpython cci package and when python is built in debug mode
static_runtime_key = "s" if "MT" in str(self.settings.compiler.runtime) else ""
debug_runtime_key = "g" if "d" in str(self.settings.compiler.runtime) else ""
debug_key = "d" if self.settings.build_type == "Debug" else ""
abi = static_runtime_key + debug_runtime_key + debug_key
if abi:
libsuffix_data["abi"] = "-{}".format(abi)
else:
debug_tag = "d" if self.settings.build_type == "Debug" else ""
abi = debug_tag
if abi:
libsuffix_data["abi"] = "-{}".format(abi)

libsuffix_data["arch"] = "-{}{}".format(self._b2_architecture[0], self._b2_address_model)
version = tools.Version(self.version)
if not version.patch or version.patch == "0":
libsuffix_data["version"] = "-{}_{}".format(version.major, version.minor)
else:
libsuffix_data["version"] = "-{}_{}_{}".format(version.major, version.minor, version.patch)
libsuffix = libsuffix_lut[str(self.options.layout)].format(**libsuffix_data)
self.output.info("Library layout suffix: {}".format(repr(libsuffix)))

libformatdata = {}
if not self.options.without_python:
Expand All @@ -1131,8 +1157,10 @@ def add_libprefix(n):
modules_seen = set()
detected_libraries = set(tools.collect_libs(self))
used_libraries = set()
for module in self._iter_modules():
if self.options.get_safe("without_{}".format(module), False) or not all(d in modules_seen for d in self._dependencies["dependencies"][module]):

for module in self._dependencies["dependencies"].keys():
missing_depmodules = list(depmodule for depmodule in self._all_dependent_modules(module) if self.options.get_safe("without_{}".format(depmodule), False))
if missing_depmodules:
continue

module_libraries = [add_libprefix(lib.format(**libformatdata)) + libsuffix for lib in self._dependencies["libs"][module]]
Expand Down
Loading