Skip to content

Commit 1b790f1

Browse files
committed
src/doc/en/installation/meson.rst: document explicit configuration
Add examples of explicit configuration using the "-Doption=value" syntax, and mention the auto_features option for package maintainers.
1 parent abdfd0f commit 1b790f1

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

src/doc/en/installation/meson.rst

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,24 @@ To configure the project, we need to run the following command:
232232
233233
$ meson setup builddir
234234
235-
This will create a build directory ``builddir`` that will hold the build
236-
artifacts.
235+
This will create a build directory ``builddir`` that will hold the
236+
build artifacts. Certain options are configurable at build time. The
237+
easiest way to obtain an overview of these options is by using ``meson
238+
configure``:
239+
240+
.. code-block:: shell-session
241+
242+
$ meson configure builddir
243+
244+
This command should display the available options and their associated
245+
values. The section titled "Project options" contains the options that
246+
are unique to SageMath. To change the value of an option, the flag
247+
``-Doption=value`` can be passed to ``meson setup``. For example, if
248+
you don't want to build the HTML documentation, you might use
249+
250+
.. code-block:: shell-session
251+
252+
$ meson setup -Dbuild-docs=false builddir
237253
238254
If pip is used as above with ``--editable``, ``builddir`` is set to be
239255
``build/cp[Python major version][Python minor version]``, such as
@@ -298,6 +314,13 @@ Alternatively, we can still use pip to install:
298314
$ meson compile -C builddir
299315
$ DESTDIR=/path/to/staging/root meson install -C builddir
300316
317+
SageMath's automatic feature detection (based on the packages that
318+
happen to be installed at build time) can be disabled in favor of
319+
explicit configuration by passing ``-Dauto_features=disabled`` to
320+
``meson setup``. Afterwards, individual features must be enabled
321+
explicitly. You can obtain a list of valid feature names through
322+
``meson configure``.
323+
301324
With the `default <https://mesonbuild.com/Running-Meson.html#installing>`_ prefix
302325
being ``/usr/local``, it may then install to
303326
``$DESTDIR/usr/local/lib/python3.12/site-packages/sage``.

0 commit comments

Comments
 (0)