Add a section about the opt_MESON_* helpers.

Sponsored by:	Absolight
This commit is contained in:
Mathieu Arnold 2017-06-09 15:04:57 +00:00
parent 0c56cdcd35
commit 40dbe56540
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=50347

View file

@ -5907,6 +5907,126 @@ CMAKE_ARGS+= -DTEST:BOOL=false -DDEBUG:BOOL=false \
</sect4> </sect4>
</sect3> </sect3>
<sect3 xml:id="options-meson-helpers">
<title><varname>MESON_ARGS</varname> Helpers</title>
<sect4 xml:id="options-meson_on">
<title><varname><replaceable>OPT</replaceable>_MESON_ON</varname>
and
<varname><replaceable>OPT</replaceable>_MESON_OFF</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
the value of
<varname><replaceable>OPT</replaceable>_MESON_ON</varname>,
if defined, is appended to <varname>MESON_ARGS</varname>.
<varname><replaceable>OPT</replaceable>_MESON_OFF</varname>
works the same way, but when <literal>OPT</literal> is
<emphasis>not</emphasis> selected. For example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
OPT1_MESON_ON= -Dopt=1
OPT1_MESON_OFF= -Dopt=2</programlisting>
<para>is equivalent to:</para>
<programlisting>OPTIONS_DEFINE= OPT1
.include &lt;bsd.port.options.mk&gt;
.if ${PORT_OPTIONS:MOPT1}
MESON_ARGS+= -Dopt=1
.else
MESON_ARGS+= -Dopt=2
.endif</programlisting>
</sect4>
<sect4 xml:id="options-meson_true">
<title><varname><replaceable>OPT</replaceable>_MESON_TRUE</varname>
and
<varname><replaceable>OPT</replaceable>_MESON_FALSE</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
for each <replaceable>entry</replaceable> in
<varname><replaceable>OPT</replaceable>_MESON_TRUE</varname>
then
<literal>-D<replaceable>entry</replaceable>=true</literal>
is appended to <varname>CMAKE_ARGS</varname>. When option
<replaceable>OPT</replaceable> is <emphasis>not</emphasis>
selected,
<literal>-D<replaceable>entry</replaceable>=false</literal>
is appended to <varname>CONFIGURE_ARGS</varname>.
<varname><replaceable>OPT</replaceable>_MESON_FALSE</varname>
is the oposite,
<literal>-D<replaceable>entry</replaceable>=false</literal>
is appended to <varname>CMAKE_ARGS</varname> when the option
is selected, and
<literal>-D<replaceable>entry</replaceable>=true</literal>
when the option is <emphasis>not</emphasis> selected. For
example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
OPT1_MESON_TRUE= test debug
OPT1_MESON_FALSE= optimize</programlisting>
<para>is equivalent to:</para>
<programlisting>OPTIONS_DEFINE= OPT1
.include &lt;bsd.port.options.mk&gt;
.if ${PORT_OPTIONS:MOPT1}
CMAKE_ARGS+= -Dtest=true -Ddebug=true \
-Doptimize=false
.else
CMAKE_ARGS+= -Dtest=false -Ddebug=false \
-Doptimize=true
.endif</programlisting>
</sect4>
<sect4 xml:id="options-meson_yes">
<title><varname><replaceable>OPT</replaceable>_MESON_YES</varname>
and
<varname><replaceable>OPT</replaceable>_MESON_NO</varname></title>
<para>When option <replaceable>OPT</replaceable> is selected,
for each <replaceable>entry</replaceable> in
<varname><replaceable>OPT</replaceable>_MESON_YES</varname>
then
<literal>-D<replaceable>entry</replaceable>=yes</literal>
is appended to <varname>CMAKE_ARGS</varname>. When option
<replaceable>OPT</replaceable> is <emphasis>not</emphasis>
selected,
<literal>-D<replaceable>entry</replaceable>=no</literal>
is appended to <varname>CONFIGURE_ARGS</varname>.
<varname><replaceable>OPT</replaceable>_MESON_NO</varname>
is the oposite,
<literal>-D<replaceable>entry</replaceable>=no</literal>
is appended to <varname>CMAKE_ARGS</varname> when the option
is selected, and
<literal>-D<replaceable>entry</replaceable>=yes</literal>
when the option is <emphasis>not</emphasis> selected. For
example:</para>
<programlisting>OPTIONS_DEFINE= OPT1
OPT1_MESON_YES= test debug
OPT1_MESON_NO= optimize</programlisting>
<para>is equivalent to:</para>
<programlisting>OPTIONS_DEFINE= OPT1
.include &lt;bsd.port.options.mk&gt;
.if ${PORT_OPTIONS:MOPT1}
CMAKE_ARGS+= -Dtest=yes -Ddebug=yes \
-Doptimize=no
.else
CMAKE_ARGS+= -Dtest=no -Ddebug=no \
-Doptimize=yes
.endif</programlisting>
</sect4>
</sect3>
<sect3 xml:id="options-qmake_on"> <sect3 xml:id="options-qmake_on">
<title><varname><replaceable>OPT</replaceable>_QMAKE_ON</varname> <title><varname><replaceable>OPT</replaceable>_QMAKE_ON</varname>
and and