On Mon, Aug 21, 2017 at 12:11 PM, Francesco Abbate
<
france...@gmail.com> wrote:
> flag '-DDEBUG' only for debug build ? More generally I found no options to
> inquire in the meson.build the 'buildtype'.
get_option('buildtype')
> 2. Meson link c++ application using 'g++' and the executable is linked to
> libstdc++. My application does not use the C++ standard library so I don't
> want to link to libstdc++. The standard way to achieve that is to link the
> executable using 'gcc' instead of 'g++' and add '-lsupc++'. How I can
> achieve that with Meson ? If possible I would prefer to avoid using
> environment variables but have these options inside the 'meson.build'.
Meson builds with -Wl,--as-needed by default so if you are not using
anything from stdlibc++ the linker should remove it from the list of
dependencies. Gcc does have command line options like -nostdlib or
-nostdinc which could do what you want but I have never used them
myself for this so you'll need to try them out yourself.
But perhaps the biggest question is does the extra library really
matter? If you don't have a really good reason (such as something
breaking if you link with stdlibc++) then maybe it is simpler to just
let it do the default thing and not worry about it.