Skip to content

Commit

Permalink
Add some documentation for the new option
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysse Gérard <[email protected]>
  • Loading branch information
voodoos committed Oct 23, 2020
1 parent 2102363 commit 186f789
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,10 @@ Here is a complete list of supported subfields:
- ``flags`` are passed when compiling source files. This field is specified
using the :ref:`ordered-set-language`, where the ``:standard`` value comes
from the environment settings ``c_flags`` and ``cxx_flags``, respectively.
Note that, for C subs, Dune unconditionally adds the flags present in the
fields ``ocamlc_cflags`` and ``ocamlc_cppflags`` of the OCaml config to the
compiler command line. This behavior can be disabled since Dune 2.8 via the
``dune-project`` option :ref:`new-foreign-flags-handling`.
- ``include_dirs`` are tracked as dependencies and passed to the compiler
via the ``-I`` flag. You can use :ref:`variables` in this field, and
refer to a library source directory using the ``(lib library-name)`` syntax.
Expand Down
17 changes: 17 additions & 0 deletions doc/dune-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,23 @@ language: The syntax is as a list of the following elements:
dep-specification = dep+
.. _new-foreign-flags-handling:

new_foreign_flags_handling
--------------------------

Since Dune 2.8, it is possible to deactivate
the systematic prepending of flags coming from ``ocamlc -config`` to the C
compiler command line. This is done adding the following field to the ``dune-project`` file:

.. code:: scheme
(new_foreign_flags_handling true)
In this mode, dune will populate the ``:standard`` set of C flags with the
content of ``ocamlc_cflags`` and ``ocamlc_cppflags``. These flags can be
completed or overridden using the :ref:`ordered-set-language`.

dune
====

Expand Down

0 comments on commit 186f789

Please sign in to comment.