Flags in Foreign Code¶
Depending on the use_standard_c_and_cxx_flags option,
the base :standard
set of flags for C will contain only ocamlc_cflags
or
both ocamlc_cflags
and ocamlc_cppflags
.
There are multiple levels where one can declare custom flags (using the Ordered Set Language), and each level inherits the flags of the previous one in its :standard set:
In the global env definition of a dune-workspace file
In the per-context env definitions in a dune-workspace file
In a foreign_stubs, foreign_library or extra_objects field of an executable or a library.
The %{cc}
variable will contain the flags
from the first three levels only.