diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py index 94ff845c92e870..66992d63fa015d 100644 --- a/recipes/boost/all/conanfile.py +++ b/recipes/boost/all/conanfile.py @@ -730,6 +730,13 @@ def _run_bcp(self): self.run(command) def build(self): + # Older clang releases require a thread_local variable to be initialized by a constant value + tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "/* thread_local */", "thread_local", strict=False) + if self.settings.compiler == "clang" and tools.Version(self.settings.compiler.version) < 6: + tools.replace_in_file(os.path.join(self.source_folder, self._source_subfolder, "boost", "stacktrace", "detail", "libbacktrace_impls.hpp"), + "thread_local", "/* thread_local */") + if self.options.header_only: self.output.warn("Header only package, skipping build") return @@ -1114,27 +1121,27 @@ def create_library_config(deps_name, name): contents += '"%s" ' % tools.which(self._ar).replace("\\", "/") if self._ranlib: contents += '"%s" ' % tools.which(self._ranlib).replace("\\", "/") - cxxflags = tools.get_env("CXXFLAGS", " ") - cflags = tools.get_env("CFLAGS", " ") - cppflags = tools.get_env("CPPFLAGS", " ") - ldflags = tools.get_env("LDFLAGS", " ") - asflags = tools.get_env("ASFLAGS", " ") + cxxflags = tools.get_env("CXXFLAGS", "") + " " + cflags = tools.get_env("CFLAGS", "") + " " + cppflags = tools.get_env("CPPFLAGS", "") + " " + ldflags = tools.get_env("LDFLAGS", "") + " " + 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[l].include_paths) + " " + ldflags += " ".join("-L{}".format(p) for p in self.deps_cpp_info[l].lib_paths) + " " if cxxflags.strip(): - contents += '"%s" ' % cxxflags + contents += '"%s" ' % cxxflags.strip() if cflags.strip(): - contents += '"%s" ' % cflags + contents += '"%s" ' % cflags.strip() if cppflags.strip(): - contents += '"%s" ' % cppflags + contents += '"%s" ' % cppflags.strip() if ldflags.strip(): - contents += '"%s" ' % ldflags + contents += '"%s" ' % ldflags.strip() if asflags.strip(): - contents += '"%s" ' % asflags + contents += '"%s" ' % asflags.strip() contents += " ;"