Skip to content

Commit

Permalink
honor tools.build:compiler_executables config & env vars from [buil…
Browse files Browse the repository at this point in the history
…denv]
  • Loading branch information
SpaceIm committed Dec 16, 2022
1 parent 9d67090 commit 0a72b33
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,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 @@ -1152,7 +1152,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 @@ -1161,7 +1161,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")
if cxx:
return cxx
if is_apple_os(self) and self.settings.compiler == "apple-clang":
Expand Down Expand Up @@ -1234,9 +1235,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

0 comments on commit 0a72b33

Please sign in to comment.