Skip to content

Commit 0c65a3c

Browse files
rgommersdnicolodi
authored andcommitted
DOC: extend documentation on environment variables
- cross link to the tables of compiler/linker flags in the Meson docs - mention `PKG_CONFIG_PATH` - add a warning about Conda's habit of injecting env vars also on the environment variables reference page Closes gh-460
1 parent d84cf99 commit 0c65a3c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/reference/environment-variables.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@
88
Environment variables
99
*********************
1010

11+
Environment variables can be used to influence ``meson-python``'s behavior, as
12+
well as the behavior of Meson and other tools that may be used during the
13+
build. This page lists all the environment variables directly used by
14+
``meson-python``.
15+
16+
Meson recommends using command line arguments instead of environment variables,
17+
but does support a number of environment variables for compatibility with other
18+
build systems:
19+
20+
- `Compiler and linker flag variables <https://mesonbuild.com/Reference-tables.html#compiler-and-linker-flag-environment-variables>`__
21+
- `Compiler and linker selection variables <https://mesonbuild.com/Reference-tables.html#compiler-and-linker-selection-variables>`__
22+
23+
Other environment variables may influence how other tools used during the setup
24+
or build steps operate. For example, ``pkg-config`` supports
25+
``PKG_CONFIG_PATH`` which influences the search path for ``.pc`` files
26+
describing the available dependencies.
27+
28+
.. warning::
29+
30+
Conda sets a number of environment variables during environment activation
31+
for compiler/linker selection (``CC``, ``CXX``, ``FC``, ``LD``) and
32+
compile/link flags (``CFLAGS``, ``CXXFLAGS``, ``FFLAGS``, ``LDFLAGS``) when
33+
compilers are installed in a conda environment. This may have unexpected
34+
side effects (see for example the note in
35+
:ref:`how-to-guides-debug-builds`).
36+
37+
38+
Environment variables used by meson-python
39+
==========================================
40+
1141
.. envvar:: ARCHFLAGS
1242

1343
This environmental variable is used for supporting architecture cross

0 commit comments

Comments
 (0)