Skip to content

Commit

Permalink
boost: fix passing of environment flags + remove thread_local for old…
Browse files Browse the repository at this point in the history
…er clang versions
  • Loading branch information
madebr committed May 4, 2021
1 parent ca1803a commit 7b39ef5
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1114,27 +1121,27 @@ def create_library_config(deps_name, name):
contents += '<archiver>"%s" ' % tools.which(self._ar).replace("\\", "/")
if self._ranlib:
contents += '<ranlib>"%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 += '<cxxflags>"%s" ' % cxxflags
contents += '<cxxflags>"%s" ' % cxxflags.strip()
if cflags.strip():
contents += '<cflags>"%s" ' % cflags
contents += '<cflags>"%s" ' % cflags.strip()
if cppflags.strip():
contents += '<compileflags>"%s" ' % cppflags
contents += '<compileflags>"%s" ' % cppflags.strip()
if ldflags.strip():
contents += '<linkflags>"%s" ' % ldflags
contents += '<linkflags>"%s" ' % ldflags.strip()
if asflags.strip():
contents += '<asmflags>"%s" ' % asflags
contents += '<asmflags>"%s" ' % asflags.strip()

contents += " ;"

Expand Down

0 comments on commit 7b39ef5

Please sign in to comment.