[libcamera-devel] [PATCH] build: Add 'std=c++11' compiler flag to libcamera

jacopo mondi jacopo at jmondi.org
Wed Dec 12 14:51:55 CET 2018


Hi Kieran,

On Wed, Dec 12, 2018 at 01:35:31PM +0000, Kieran Bingham wrote:
> Hi Jacopo,
>
> On 12/12/2018 13:31, Jacopo Mondi wrote:
> > Building the current master branch fails with:
> > ./src/libcamera/include/log.h:25:34:
> >    error: defaulted and deleted functions only available with -std=c++11 \
> >    or -std=gnu++11 [-Werror]
> >    LogMessage(const LogMessage&) = delete;
> >
> > Fix this by adding the 'std=c++11' compiler argument to the src/libcamera
> > build file.
> >
> > Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> > ---
> >  src/libcamera/meson.build | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > index 0c44b5a..4457cde 100644
> > --- a/src/libcamera/meson.build
> > +++ b/src/libcamera/meson.build
> > @@ -16,4 +16,5 @@ includes = [
> >  libcamera = shared_library('camera',
> >                             libcamera_sources,
> >                             install : true,
> > -                           include_directories : includes)
> > +                           include_directories : includes,
> > +                           cpp_args : '-std=c++11')
>
>
> Does this override - or add to the arguments I've already created in the
> top level meson.build ?

That's the ninja verbose output when building libcamera

[1/10] ccache c++ -Isrc/libcamera/src at libcamera@@camera at sha -Isrc/libcamera -I../src/libcamera -Iinclude -I../include -I../src/libcamera/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -g -Wall -Wextra -Werror -Wno-unused-parameter -fPIC -std=c++11  -MD -MQ 'src/libcamera/src at libcamera@@camera at sha/log.cpp.o' -MF 'src/libcamera/src at libcamera@@camera at sha/log.cpp.o.d' -o 'src/libcamera/src at libcamera@@camera at sha/log.cpp.o' -c ../src/libcamera/log.cpp

sorry, it sucks, but I see here both the globals:
-Wall -Wextra -Werror -Wno-unused-parameter

and the new:
-std=c++11

>
> As this will be a project wide requirement - could you add that argument
> to the global cpp_arguments before they get added to the project please?
>

I ended up setting it only for src/libcamera target because otherwise:

ccache cc -Iutils/ipu3/utils at ipu3@@ipu3-unpack at exe ...
cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C

when building utils/

It's true that I added it as part of the 'common_arguments' array, but
from the documentation and a few other attempts I've made, the meson's
'cpp_args' field is available only inside the target argument list
https://mesonbuild.com/Adding-arguments.html

>
>
> > --
> > 2.7.4
> >
> > _______________________________________________
> > libcamera-devel mailing list
> > libcamera-devel at lists.libcamera.org
> > https://lists.libcamera.org/listinfo/libcamera-devel
> >
>
> --
> Regards
> --
> Kieran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20181212/356a2dd3/attachment.sig>


More information about the libcamera-devel mailing list