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: honor tools.build:compiler_executables config & env vars from [buildenv] #14776

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
12 changes: 7 additions & 5 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ def _build_cross_flags(self):

@property
def _ar(self):
ar = self.buildenv.vars(self).get("AR")
ar = VirtualBuildEnv(self).vars().get("AR")
if ar:
return ar
if is_apple_os(self) and self.settings.compiler == "apple-clang":
Expand All @@ -1176,7 +1176,7 @@ def _ar(self):

@property
def _ranlib(self):
ranlib = self.buildenv.vars(self).get("RANLIB")
ranlib = VirtualBuildEnv(self).vars().get("RANLIB")
if ranlib:
return ranlib
if is_apple_os(self) and self.settings.compiler == "apple-clang":
Expand All @@ -1185,7 +1185,8 @@ def _ranlib(self):

@property
def _cxx(self):
cxx = self.buildenv.vars(self).get("CXX")
compilers_by_conf = self.conf.get("tools.build:compiler_executables", default={}, check_type=dict)
cxx = compilers_by_conf.get("cpp") or VirtualBuildEnv(self).vars().get("CXX")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure the 2.0 stuff should move forward with env vars or us the compilers from conf 🤔 but I think we can wait to see how that recommendation falls out

This matches with the explanation I got about how this feature works

if cxx:
return cxx
if is_apple_os(self) and self.settings.compiler == "apple-clang":
Expand Down Expand Up @@ -1258,9 +1259,10 @@ def create_library_config(deps_name, name):
contents += f'<ranlib>"{ranlib_path}" '
cxxflags = " ".join(self.conf.get("tools.build:cxxflags", default=[], check_type=list)) + " "
cflags = " ".join(self.conf.get("tools.build:cflags", default=[], check_type=list)) + " "
cppflags = self.buildenv.vars(self).get("CPPFLAGS", "") + " "
buildenv_vars = VirtualBuildEnv(self).vars()
cppflags = buildenv_vars.get("CPPFLAGS", "") + " "
ldflags = " ".join(self.conf.get("tools.build:sharedlinkflags", default=[], check_type=list)) + " "
asflags = self.buildenv.vars(self).get("ASFLAGS", "") + " "
asflags = buildenv_vars.get("ASFLAGS", "") + " "

if self._with_stacktrace_backtrace:
cppflags += " ".join(f"-I{p}" for p in self.dependencies["libbacktrace"].cpp_info.includedirs) + " "
Expand Down