Skip to content

Commit

Permalink
(#8632) cpython: Add PATH variable only if env_vars option is enabled.
Browse files Browse the repository at this point in the history
Also add small info string fix to PYTHONHOME.
  • Loading branch information
sh0 authored Jan 12, 2022
1 parent a4eebcf commit b60e3d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions recipes/cpython/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,10 @@ def package_info(self):
self.cpp_info.components["_hidden"].requires.append("tk::tk")
self.cpp_info.components["_hidden"].libdirs = []

bindir = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bindir))
self.env_info.PATH.append(bindir)
if self.options.env_vars:
bindir = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bindir))
self.env_info.PATH.append(bindir)

python = self._cpython_interpreter_path
self.user_info.python = python
Expand All @@ -724,7 +725,7 @@ def package_info(self):

if self.settings.compiler == "Visual Studio":
if self.options.env_vars:
self.output.info("Setting PYTHON environment variable: {}".format(pythonhome))
self.output.info("Setting PYTHONHOME environment variable: {}".format(pythonhome))
self.env_info.PYTHONHOME = pythonhome

if self._is_py2:
Expand Down

0 comments on commit b60e3d7

Please sign in to comment.