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: Treat empty CXX, AR, RANLIB env as undefined #5593

Merged
merged 1 commit into from
May 26, 2021
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
6 changes: 3 additions & 3 deletions recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,23 +1044,23 @@ def _build_cross_flags(self):

@property
def _ar(self):
if "AR" in os.environ:
if os.environ.get("AR"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Use tools.get_env instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like tools.get_env (aka conans.util.env_reader.get_env) doesn't really do anything when the default is None or a str as it is in this case, it seems like the purpose is to coerce the type when default is a bool, int, float, or list.

return os.environ["AR"]
if tools.is_apple_os(self.settings.os) and self.settings.compiler == "apple-clang":
return tools.XCRun(self.settings).ar
return None

@property
def _ranlib(self):
if "RANLIB" in os.environ:
if os.environ.get("RANLIB"):
return os.environ["RANLIB"]
if tools.is_apple_os(self.settings.os) and self.settings.compiler == "apple-clang":
return tools.XCRun(self.settings).ranlib
return None

@property
def _cxx(self):
if "CXX" in os.environ:
if os.environ.get("CXX"):
return os.environ["CXX"]
if tools.is_apple_os(self.settings.os) and self.settings.compiler == "apple-clang":
return tools.XCRun(self.settings).cxx
Expand Down