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: fix with_stacktrace_backtrace for Macos & MinGW + bump dependencies #5577

Merged
merged 9 commits into from
May 23, 2021
22 changes: 8 additions & 14 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def config_options(self):
if "without_{}".format(opt_name) not in self.options:
raise ConanException("{} has the configure options {} which is not available in conanfile.py".format(self._dependency_filename, opt_name))

# libbacktrace cannot be built on Visual Studio
# libbacktrace is not usable with Visual Studio
if self.settings.compiler == "Visual Studio":
del self.options.with_stacktrace_backtrace

Expand Down Expand Up @@ -457,10 +457,9 @@ def requirements(self):
if self._with_lzma:
self.requires("xz_utils/5.2.5")
if self._with_zstd:
self.requires("zstd/1.4.9")
self.requires("zstd/1.5.0")
if self._with_stacktrace_backtrace:
self.requires("libbacktrace/cci.20210118")
self.requires("libunwind/1.5.0")

if self._with_icu:
self.requires("icu/68.2")
Expand All @@ -481,8 +480,8 @@ def package_id(self):
self.info.options.python_version = self._python_version

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("boost_%s" % self.version.replace(".", "_"), self._source_subfolder)
tools.get(**self.conan_data["sources"][self.version],
destination=self._source_subfolder, strip_root=True)
for patch in self.conan_data.get("patches", {}).get(self.version, []):
tools.patch(**patch)

Expand Down Expand Up @@ -1137,9 +1136,8 @@ def create_library_config(deps_name, name):
asflags = tools.get_env("ASFLAGS", "") + " "

if self._with_stacktrace_backtrace:
for l in ("libbacktrace", "libunwind"):
cppflags += " ".join("-I{}".format(p) for p in self.deps_cpp_info[l].include_paths) + " "
ldflags += " ".join("-L{}".format(p) for p in self.deps_cpp_info[l].lib_paths) + " "
cppflags += " ".join("-I{}".format(p) for p in self.deps_cpp_info["libbacktrace"].include_paths) + " "
ldflags += " ".join("-L{}".format(p) for p in self.deps_cpp_info["libbacktrace"].lib_paths) + " "

if cxxflags.strip():
contents += '<cxxflags>"%s" ' % cxxflags.strip()
Expand Down Expand Up @@ -1238,7 +1236,7 @@ def package(self):
if dll_pdbs:
tools.mkdir(os.path.join(self.package_folder, "bin"))
for bin_file in dll_pdbs:
os.rename(bin_file, os.path.join(self.package_folder, "bin", os.path.basename(bin_file)))
tools.rename(bin_file, os.path.join(self.package_folder, "bin", os.path.basename(bin_file)))

tools.remove_files_by_mask(os.path.join(self.package_folder, "bin"), "*.pdb")

Expand Down Expand Up @@ -1473,11 +1471,7 @@ def filter_transform_module_libraries(names):

if self._with_stacktrace_backtrace:
self.cpp_info.components["stacktrace_backtrace"].defines.append("BOOST_STACKTRACE_USE_BACKTRACE")
self.cpp_info.components["stacktrace_backtrace"].system_libs.append("dl")
self.cpp_info.components["stacktrace_backtrace"].requires.extend([
"libunwind::libunwind",
"libbacktrace::libbacktrace",
])
self.cpp_info.components["stacktrace_backtrace"].requires.append("libbacktrace::libbacktrace")

self.cpp_info.components["stacktrace_noop"].defines.append("BOOST_STACKTRACE_USE_NOOP")

Expand Down