Skip to content

Commit

Permalink
Adding documentation in tools.rst to the feature suggested in conan-i…
Browse files Browse the repository at this point in the history
…o/conan#4168 and being proposed to be included in the corresponding PR (conan-io#1003)
  • Loading branch information
alacasta authored and jgsogo committed Jan 11, 2019
1 parent b27c524 commit a52e057
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions reference/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,12 @@ in your conanfile:
from conans import tools
def build(self):
with tools.environment_append({"MY_VAR": "3", "CXX": "/path/to/cxx"}):
with tools.environment_append({"MY_VAR": "3", "CXX": "/path/to/cxx", "CPPFLAGS": None}):
do_something()
The environment variables will be overridden if the value is a string, while it will be prepended if the value is a list. When the context
manager block ends, the environment variables will be unset.
The environment variables will be overridden if the value is a string, while it will be prepended if the value is a list.
Additionally, if value is ``None``, the given environment variable is unset (In the previous example, ``CPPFLAGS`` environment
variable will be unset). When the context manager block ends, the environment variables will recover their previous state.

Parameters:
- **env_vars** (Required): Dictionary object with environment variable name and its value.
Expand Down

0 comments on commit a52e057

Please sign in to comment.